diff --git a/src/main/java/org/springframework/hateoas/AffordanceModel.java b/src/main/java/org/springframework/hateoas/AffordanceModel.java index b49bee8d..36e6059f 100644 --- a/src/main/java/org/springframework/hateoas/AffordanceModel.java +++ b/src/main/java/org/springframework/hateoas/AffordanceModel.java @@ -149,8 +149,8 @@ public abstract class AffordanceModel { */ public List createProperties(BiFunction creator) { - return input.stream() - .map(it -> creator.apply(input, it)) + return input.stream() // + .map(it -> creator.apply(input, it)) // .collect(Collectors.toList()); } diff --git a/src/main/java/org/springframework/hateoas/mediatype/PropertyUtils.java b/src/main/java/org/springframework/hateoas/mediatype/PropertyUtils.java index ca5ae1a5..ab1ad08b 100644 --- a/src/main/java/org/springframework/hateoas/mediatype/PropertyUtils.java +++ b/src/main/java/org/springframework/hateoas/mediatype/PropertyUtils.java @@ -435,7 +435,7 @@ public class PropertyUtils { static { - INPUT_TYPE_FACTORY = SpringFactoriesLoader.loadFactories(InputTypeFactory.class, + INPUT_TYPE_FACTORY = SpringFactoriesLoader.loadFactories(InputTypeFactory.class, // DefaultPropertyMetadata.class.getClassLoader()).get(0); } @@ -528,8 +528,8 @@ public class PropertyUtils { String annotatedInputType = getAnnotatedInputType(); - return annotatedInputType != null - ? annotatedInputType + return annotatedInputType != null // + ? annotatedInputType // : INPUT_TYPE_FACTORY.getInputType(getType().resolve(Object.class)); } @@ -684,8 +684,8 @@ public class PropertyUtils { @Nullable @Override public Long getMinLength() { - return LENGTH_ANNOTATION.flatMap(it -> getAnnotationAttribute(it, "min", Integer.class)) - .map(Integer::longValue) + return LENGTH_ANNOTATION.flatMap(it -> getAnnotationAttribute(it, "min", Integer.class)) // + .map(Integer::longValue) // .orElse(null); } @@ -696,8 +696,8 @@ public class PropertyUtils { @Nullable @Override public Long getMaxLength() { - return LENGTH_ANNOTATION.flatMap(it -> getAnnotationAttribute(it, "max", Integer.class)) - .map(Integer::longValue) + return LENGTH_ANNOTATION.flatMap(it -> getAnnotationAttribute(it, "max", Integer.class)) // + .map(Integer::longValue) // .orElse(null); } @@ -733,14 +733,14 @@ public class PropertyUtils { private String lookupFromTypeMap() { - return TYPE_MAP.entrySet().stream() + return TYPE_MAP.entrySet().stream() // .flatMap(it -> { MergedAnnotation annotation = property.getAnnotation(it.getKey()); return annotation.isPresent() ? Stream.of(it.getValue()) : Stream.empty(); - }) - .findFirst() + }) // + .findFirst() // .orElse(null); } diff --git a/src/main/java/org/springframework/hateoas/mediatype/hal/forms/HalFormsProperty.java b/src/main/java/org/springframework/hateoas/mediatype/hal/forms/HalFormsProperty.java index 468b38e0..e6eb5cfe 100644 --- a/src/main/java/org/springframework/hateoas/mediatype/hal/forms/HalFormsProperty.java +++ b/src/main/java/org/springframework/hateoas/mediatype/hal/forms/HalFormsProperty.java @@ -67,7 +67,7 @@ final class HalFormsProperty implements Named { } private HalFormsProperty(String name, boolean readOnly, @Nullable Object value, String prompt, String regex, - boolean templated, + boolean templated, // boolean required, boolean multi, String placeholder, @Nullable Number min, @Nullable Number max, @Nullable Long minLength, @Nullable Long maxLength, @Nullable HtmlInputType type, @Nullable HalFormsOptions options) { diff --git a/src/test/java/org/springframework/hateoas/mediatype/hal/forms/HalFormsTemplateBuilderUnitTest.java b/src/test/java/org/springframework/hateoas/mediatype/hal/forms/HalFormsTemplateBuilderUnitTest.java index 9c798b4c..422e4e5b 100644 --- a/src/test/java/org/springframework/hateoas/mediatype/hal/forms/HalFormsTemplateBuilderUnitTest.java +++ b/src/test/java/org/springframework/hateoas/mediatype/hal/forms/HalFormsTemplateBuilderUnitTest.java @@ -111,7 +111,7 @@ class HalFormsTemplateBuilderUnitTest { .withInput(Payload.class) // .toLink(); - HalFormsTemplate template = new HalFormsTemplateBuilder(new HalFormsConfiguration(), + HalFormsTemplate template = new HalFormsTemplateBuilder(new HalFormsConfiguration(), // MessageResolver.DEFAULTS_ONLY).findTemplates(new RepresentationModel<>().add(link)).get("default"); Optional number = template.getPropertyByName("number"); @@ -149,7 +149,7 @@ class HalFormsTemplateBuilderUnitTest { Link link = Affordances.of(Link.of("/example", LinkRelation.of("create"))) // .afford(HttpMethod.POST) // .withInput(Payload.class) // - .withName("create") + .withName("create") // .toLink(); Map templates = new HalFormsTemplateBuilder(new HalFormsConfiguration(), @@ -181,21 +181,21 @@ class HalFormsTemplateBuilderUnitTest { List values = Arrays.asList("1234123412341234", "4321432143214321"); - HalFormsConfiguration configuration = new HalFormsConfiguration() + HalFormsConfiguration configuration = new HalFormsConfiguration() // .withOptions(PatternExample.class, "number", metadata -> HalFormsOptions.inline(values)); RepresentationModel models = new RepresentationModel<>( - Affordances.of(Link.of("/example", LinkRelation.of("create"))) - .afford(HttpMethod.POST) - .withInput(PatternExample.class) + Affordances.of(Link.of("/example", LinkRelation.of("create"))) // + .afford(HttpMethod.POST) // + .withInput(PatternExample.class) // .toLink()); Map templates = new HalFormsTemplateBuilder(configuration, MessageResolver.DEFAULTS_ONLY) .findTemplates(models); - assertThat(templates.get("default").getPropertyByName("number")) + assertThat(templates.get("default").getPropertyByName("number")) // .hasValueSatisfying(it -> { - assertThat(it.getOptions()).isNotNull() + assertThat(it.getOptions()).isNotNull() // .isInstanceOfSatisfying(HalFormsOptions.Inline.class, inline -> assertThat(inline.getInline()).isEqualTo(values)); }); @@ -207,14 +207,14 @@ class HalFormsTemplateBuilderUnitTest { String selected = "1234123412341234"; List values = Arrays.asList(selected, "4321432143214321"); - HalFormsConfiguration configuration = new HalFormsConfiguration() + HalFormsConfiguration configuration = new HalFormsConfiguration() // .withOptions(PatternExample.class, "number", metadata -> HalFormsOptions.inline(values).withSelectedValue(selected)); RepresentationModel models = new RepresentationModel<>( - Affordances.of(Link.of("/example", LinkRelation.of("create"))) - .afford(HttpMethod.POST) - .withInput(PatternExample.class) + Affordances.of(Link.of("/example", LinkRelation.of("create"))) // + .afford(HttpMethod.POST) // + .withInput(PatternExample.class) // .toLink()); Map templates = new HalFormsTemplateBuilder(configuration, MessageResolver.DEFAULTS_ONLY)