Skip to content

Commit

Permalink
Remove redundant access modifiers from interfaces. (#2350)
Browse files Browse the repository at this point in the history
  • Loading branch information
SomeoneToIgnore authored Sep 8, 2017
1 parent 9369d81 commit b469704
Show file tree
Hide file tree
Showing 37 changed files with 185 additions and 182 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public interface JsMap<K, V> {
*/
@FunctionalInterface
@JsFunction
public interface ForEachCallback<K, V> {
interface ForEachCallback<K, V> {
/**
* Receives one key-value pair.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import com.vaadin.flow.template.angular.StaticBindingValueProvider;

import elemental.json.JsonValue;

import jsinterop.annotations.JsOverlay;
import jsinterop.annotations.JsProperty;
import jsinterop.annotations.JsType;
Expand All @@ -34,17 +35,17 @@ public interface TestBinding extends Binding {
void setValue(String value);

@JsOverlay
public static TestBinding createStatic(String value) {
static TestBinding createStatic(String value) {
return createBinding(StaticBindingValueProvider.TYPE, value);
}

@JsOverlay
public static TestBinding createTextValueBinding(String value) {
static TestBinding createTextValueBinding(String value) {
return createBinding(ModelValueBindingProvider.TYPE, value);
}

@JsOverlay
public static TestBinding createBinding(String type, String value) {
static TestBinding createBinding(String type, String value) {
TestBinding binding = WidgetUtil
.crazyJsCast(JavaScriptObject.createObject());
binding.setType(type);
Expand All @@ -54,7 +55,7 @@ public static TestBinding createBinding(String type, String value) {
}

@JsOverlay
public default JsonValue asJson() {
default JsonValue asJson() {
return WidgetUtil.crazyJsCast(this);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

import elemental.json.Json;
import elemental.json.JsonObject;

import jsinterop.annotations.JsOverlay;
import jsinterop.annotations.JsProperty;
import jsinterop.annotations.JsType;
Expand All @@ -26,22 +27,22 @@ public interface TestElementTemplateNode
extends ElementTemplateNode, TestTemplateNode {

@JsProperty
public void setTag(String tag);
void setTag(String tag);

@JsProperty
public void setProperties(JsonObject properties);
void setProperties(JsonObject properties);

@JsProperty
public void setAttributes(JsonObject attributes);
void setAttributes(JsonObject attributes);

@JsProperty
public void setClassNames(JsonObject classNames);
void setClassNames(JsonObject classNames);

@JsProperty
public void setEventHandlers(JsonObject handlers);
void setEventHandlers(JsonObject handlers);

@JsOverlay
public static TestElementTemplateNode create(String tag) {
static TestElementTemplateNode create(String tag) {
TestElementTemplateNode templateNode = TestTemplateNode
.create("element");
templateNode.setTag(tag);
Expand All @@ -50,34 +51,34 @@ public static TestElementTemplateNode create(String tag) {
}

@JsOverlay
public default void addProperty(String name, String staticValue) {
default void addProperty(String name, String staticValue) {
doGetProperties().put(name,
TestBinding.createStatic(staticValue).asJson());
}

@JsOverlay
public default void addProperty(String name, TestBinding binding) {
default void addProperty(String name, TestBinding binding) {
doGetProperties().put(name, binding.asJson());
}

@JsOverlay
public default void addAttribute(String name, TestBinding binding) {
default void addAttribute(String name, TestBinding binding) {
doGetAttributes().put(name, binding.asJson());
}

@JsOverlay
public default void addClassName(String name, String staticValue) {
default void addClassName(String name, String staticValue) {
doGetClassNames().put(name,
TestBinding.createStatic(staticValue).asJson());
}

@JsOverlay
public default void addClassName(String name, TestBinding binding) {
default void addClassName(String name, TestBinding binding) {
doGetClassNames().put(name, binding.asJson());
}

@JsOverlay
public default void addEventHandler(String name, String handler) {
default void addEventHandler(String name, String handler) {
JsonObject eventHandlers = getEventHandlers();
if (eventHandlers == null) {
eventHandlers = Json.createObject();
Expand All @@ -87,7 +88,7 @@ public default void addEventHandler(String name, String handler) {
}

@JsOverlay
public default JsonObject doGetProperties() {
default JsonObject doGetProperties() {
JsonObject properties = getProperties();
if (properties == null) {
properties = Json.createObject();
Expand All @@ -97,7 +98,7 @@ public default JsonObject doGetProperties() {
}

@JsOverlay
public default JsonObject doGetClassNames() {
default JsonObject doGetClassNames() {
JsonObject classNames = getClassNames();
if (classNames == null) {
classNames = Json.createObject();
Expand All @@ -107,7 +108,7 @@ public default JsonObject doGetClassNames() {
}

@JsOverlay
public default JsonObject doGetAttributes() {
default JsonObject doGetAttributes() {
JsonObject attributes = getAttributes();
if (attributes == null) {
attributes = Json.createObject();
Expand All @@ -117,7 +118,7 @@ public default JsonObject doGetAttributes() {
}

@JsOverlay
public default void addAttribute(String name, String staticValue) {
default void addAttribute(String name, String staticValue) {
doGetAttributes().put(name,
TestBinding.createStatic(staticValue).asJson());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@
public interface TestForTemplateNode extends ForTemplateNode, TestTemplateNode {

@JsProperty
public void setLoopVariable(String variable);
void setLoopVariable(String variable);

@JsProperty
public void setCollectionVariable(String variable);
void setCollectionVariable(String variable);

}
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,14 @@
@JsType(isNative = true)
public interface TestTemplateNode extends TemplateNode {
@JsProperty
public void setType(String type);
void setType(String type);

@JsProperty(name = JsonConstants.CHILD_TEMPLATE_KEY)
public void setChildrenIds(double[] children);
void setChildrenIds(double[] children);

@SuppressWarnings("unchecked")
@JsOverlay
public static <T extends TestTemplateNode> T create(String type) {
static <T extends TestTemplateNode> T create(String type) {
TestTemplateNode templateNode = WidgetUtil
.crazyJsCast(JavaScriptObject.createObject());
templateNode.setType(type);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@
@JsType(isNative = true)
public interface TestTextTemplate extends TestTemplateNode, TextTemplateNode {
@JsProperty(name = "binding")
public void setTextBinding(Binding binding);
void setTextBinding(Binding binding);

@JsOverlay
public static TestTextTemplate create(Binding binding) {
static TestTextTemplate create(Binding binding) {
TestTextTemplate template = TestTemplateNode.create("text");
template.setTextBinding(binding);
return template;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public interface HasValue<C extends Component, V>
* @param <V>
* the value type
*/
public class ValueChangeEvent<C extends Component, V>
class ValueChangeEvent<C extends Component, V>
extends ComponentEvent<C> {

private final V oldValue;
Expand Down Expand Up @@ -107,7 +107,7 @@ public V getValue() {
* @see Registration
*/
@FunctionalInterface
public interface ValueChangeListener<C extends Component, V> extends
interface ValueChangeListener<C extends Component, V> extends
ComponentEventListener<ValueChangeEvent<C, V>>, Serializable {

/**
Expand Down Expand Up @@ -293,7 +293,7 @@ default boolean isRequiredIndicatorVisible() {
* @since 8.1
* @return internal state validator
*/
public default Validator<V> getDefaultValidator() {
default Validator<V> getDefaultValidator() {
return Validator.alwaysPass();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
import java.util.stream.Stream;

import com.googlecode.gentyref.GenericTypeReflector;

import com.vaadin.annotations.PropertyId;
import com.vaadin.components.data.HasValue;
import com.vaadin.components.data.HasValue.ValueChangeEvent;
Expand Down Expand Up @@ -114,7 +115,7 @@ public interface Binding<BEAN, TARGET> extends Serializable {
*
* @return the field for the binding
*/
public HasValue<?, ?> getField();
HasValue<?, ?> getField();

/**
* Validates the field value and returns a {@code ValidationStatus}
Expand All @@ -125,7 +126,7 @@ public interface Binding<BEAN, TARGET> extends Serializable {
*
* @return the validation result.
*/
public BindingValidationStatus<TARGET> validate();
BindingValidationStatus<TARGET> validate();

}

Expand All @@ -147,7 +148,7 @@ public interface BindingBuilder<BEAN, TARGET> extends Serializable {
*
* @return the field this binding is being built for
*/
public HasValue<?, ?> getField();
HasValue<?, ?> getField();

/**
* Completes this binding using the given getter and setter functions
Expand Down Expand Up @@ -189,8 +190,8 @@ public interface BindingBuilder<BEAN, TARGET> extends Serializable {
* @throws IllegalStateException
* if {@code bind} has already been called on this binding
*/
public Binding<BEAN, TARGET> bind(ValueProvider<BEAN, TARGET> getter,
Setter<BEAN, TARGET> setter);
Binding<BEAN, TARGET> bind(ValueProvider<BEAN, TARGET> getter,
Setter<BEAN, TARGET> setter);

/**
* Completes this binding by connecting the field to the property with
Expand Down Expand Up @@ -221,7 +222,7 @@ public Binding<BEAN, TARGET> bind(ValueProvider<BEAN, TARGET> getter,
*
* @see Binder.BindingBuilder#bind(ValueProvider, Setter)
*/
public Binding<BEAN, TARGET> bind(String propertyName);
Binding<BEAN, TARGET> bind(String propertyName);

/**
* Adds a validator to this binding. Validators are applied, in
Expand All @@ -238,7 +239,7 @@ public Binding<BEAN, TARGET> bind(ValueProvider<BEAN, TARGET> getter,
* @throws IllegalStateException
* if {@code bind} has already been called
*/
public BindingBuilder<BEAN, TARGET> withValidator(
BindingBuilder<BEAN, TARGET> withValidator(
Validator<? super TARGET> validator);

/**
Expand All @@ -261,7 +262,7 @@ public BindingBuilder<BEAN, TARGET> withValidator(
* @throws IllegalStateException
* if {@code bind} has already been called
*/
public default BindingBuilder<BEAN, TARGET> withValidator(
default BindingBuilder<BEAN, TARGET> withValidator(
SerializablePredicate<? super TARGET> predicate,
String message) {
return withValidator(Validator.from(predicate, message));
Expand All @@ -288,7 +289,7 @@ public default BindingBuilder<BEAN, TARGET> withValidator(
* @throws IllegalStateException
* if {@code bind} has already been called
*/
public default BindingBuilder<BEAN, TARGET> withValidator(
default BindingBuilder<BEAN, TARGET> withValidator(
SerializablePredicate<? super TARGET> predicate,
ErrorMessageProvider errorMessageProvider) {
return withValidator(
Expand Down Expand Up @@ -318,7 +319,7 @@ public default BindingBuilder<BEAN, TARGET> withValidator(
* @throws IllegalStateException
* if {@code bind} has already been called
*/
public <NEWTARGET> BindingBuilder<BEAN, NEWTARGET> withConverter(
<NEWTARGET> BindingBuilder<BEAN, NEWTARGET> withConverter(
Converter<TARGET, NEWTARGET> converter);

/**
Expand Down Expand Up @@ -348,7 +349,7 @@ public <NEWTARGET> BindingBuilder<BEAN, NEWTARGET> withConverter(
* @throws IllegalStateException
* if {@code bind} has already been called
*/
public default <NEWTARGET> BindingBuilder<BEAN, NEWTARGET> withConverter(
default <NEWTARGET> BindingBuilder<BEAN, NEWTARGET> withConverter(
SerializableFunction<TARGET, NEWTARGET> toModel,
SerializableFunction<NEWTARGET, TARGET> toPresentation) {
return withConverter(Converter.from(toModel, toPresentation,
Expand Down Expand Up @@ -386,7 +387,7 @@ public default <NEWTARGET> BindingBuilder<BEAN, NEWTARGET> withConverter(
* @throws IllegalStateException
* if {@code bind} has already been called
*/
public default <NEWTARGET> BindingBuilder<BEAN, NEWTARGET> withConverter(
default <NEWTARGET> BindingBuilder<BEAN, NEWTARGET> withConverter(
SerializableFunction<TARGET, NEWTARGET> toModel,
SerializableFunction<NEWTARGET, TARGET> toPresentation,
String errorMessage) {
Expand All @@ -402,7 +403,7 @@ public default <NEWTARGET> BindingBuilder<BEAN, NEWTARGET> withConverter(
* the value to use instead of {@code null}
* @return a new binding with null representation handling.
*/
public default BindingBuilder<BEAN, TARGET> withNullRepresentation(
default BindingBuilder<BEAN, TARGET> withNullRepresentation(
TARGET nullRepresentation) {
return withConverter(
fieldValue -> Objects.equals(fieldValue, nullRepresentation)
Expand Down Expand Up @@ -436,7 +437,7 @@ public default BindingBuilder<BEAN, TARGET> withNullRepresentation(
* label to show validation status for the field
* @return this binding, for chaining
*/
public default BindingBuilder<BEAN, TARGET> withStatusLabel(
default BindingBuilder<BEAN, TARGET> withStatusLabel(
Label label) {
return withValidationStatusHandler(status -> {
label.setText(status.getMessage().orElse(""));
Expand Down Expand Up @@ -466,7 +467,7 @@ public default BindingBuilder<BEAN, TARGET> withStatusLabel(
* status change handler
* @return this binding, for chaining
*/
public BindingBuilder<BEAN, TARGET> withValidationStatusHandler(
BindingBuilder<BEAN, TARGET> withValidationStatusHandler(
BindingValidationStatusHandler handler);

/**
Expand All @@ -488,7 +489,7 @@ public BindingBuilder<BEAN, TARGET> withValidationStatusHandler(
* the error message to show for the invalid value
* @return this binding, for chaining
*/
public default BindingBuilder<BEAN, TARGET> asRequired(
default BindingBuilder<BEAN, TARGET> asRequired(
String errorMessage) {
return asRequired(context -> errorMessage);
}
Expand All @@ -508,7 +509,7 @@ public default BindingBuilder<BEAN, TARGET> asRequired(
* the provider for localized validation error message
* @return this binding, for chaining
*/
public BindingBuilder<BEAN, TARGET> asRequired(
BindingBuilder<BEAN, TARGET> asRequired(
ErrorMessageProvider errorMessageProvider);

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,5 +43,5 @@ public interface BindingValidationStatusHandler
* @param statusChange
* the changed status
*/
public void statusChange(BindingValidationStatus<?> statusChange);
void statusChange(BindingValidationStatus<?> statusChange);
}
Loading

0 comments on commit b469704

Please sign in to comment.