#1201 - Switched to EntityModel factory methods where possible.

This commit is contained in:
Oliver Drotbohm
2020-02-11 18:08:34 +01:00
parent 290b58858a
commit 9a73194e1b
4 changed files with 4 additions and 4 deletions

View File

@@ -886,7 +886,7 @@ public class Jackson2CollectionJsonModule extends SimpleModule {
static class CollectionJsonResourcesDeserializer extends CollectionJsonDeserializerBase<CollectionModel<?>> {
private static final long serialVersionUID = 6406522912020578141L;
private static final BiFunction<List<Object>, Links, CollectionModel<?>> FINISHER = CollectionModel::new;
private static final BiFunction<List<Object>, Links, CollectionModel<?>> FINISHER = CollectionModel::of;
private static final Function<JavaType, CollectionJsonDeserializerBase<CollectionModel<?>>> CONTEXTUAL_CREATOR = CollectionJsonResourcesDeserializer::new;
CollectionJsonResourcesDeserializer() {

View File

@@ -48,6 +48,6 @@ public interface RepresentationModelAssembler<T, D extends RepresentationModel<?
return StreamSupport.stream(entities.spliterator(), false) //
.map(this::toModel) //
.collect(Collectors.collectingAndThen(Collectors.toList(), CollectionModel::new));
.collect(Collectors.collectingAndThen(Collectors.toList(), CollectionModel::of));
}
}

View File

@@ -52,6 +52,6 @@ public interface ReactiveRepresentationModelAssembler<T, D extends Representatio
return entities.flatMap(entity -> toModel(entity, exchange)) //
.collectList() //
.map(CollectionModel::new);
.map(CollectionModel::of);
}
}

View File

@@ -68,7 +68,7 @@ public interface SimpleReactiveRepresentationModelAssembler<T>
return entities //
.flatMap(entity -> toModel(entity, exchange)) //
.collectList() //
.map(CollectionModel::new) //
.map(CollectionModel::of) //
.map(it -> addLinks(it, exchange));
}