#1202 - Polish imports and formatting.
This commit is contained in:
@@ -18,10 +18,10 @@ package org.springframework.hateoas.mediatype;
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.hateoas.AffordanceModel;
|
||||
import org.springframework.hateoas.Link;
|
||||
import org.springframework.hateoas.QueryParameter;
|
||||
import org.springframework.hateoas.AffordanceModel.InputPayloadMetadata;
|
||||
import org.springframework.hateoas.AffordanceModel.PayloadMetadata;
|
||||
import org.springframework.hateoas.Link;
|
||||
import org.springframework.hateoas.QueryParameter;
|
||||
import org.springframework.http.HttpMethod;
|
||||
import org.springframework.http.MediaType;
|
||||
|
||||
|
||||
@@ -15,8 +15,8 @@
|
||||
*/
|
||||
package org.springframework.hateoas.mediatype;
|
||||
|
||||
import org.springframework.hateoas.EntityModel;
|
||||
import org.springframework.hateoas.CollectionModel;
|
||||
import org.springframework.hateoas.EntityModel;
|
||||
|
||||
import com.fasterxml.jackson.databind.JavaType;
|
||||
|
||||
|
||||
@@ -22,10 +22,10 @@ import java.util.List;
|
||||
import org.springframework.hateoas.AffordanceModel;
|
||||
import org.springframework.hateoas.AffordanceModel.InputPayloadMetadata;
|
||||
import org.springframework.hateoas.AffordanceModel.PayloadMetadata;
|
||||
import org.springframework.hateoas.mediatype.AffordanceModelFactory;
|
||||
import org.springframework.hateoas.Link;
|
||||
import org.springframework.hateoas.MediaTypes;
|
||||
import org.springframework.hateoas.QueryParameter;
|
||||
import org.springframework.hateoas.mediatype.AffordanceModelFactory;
|
||||
import org.springframework.http.HttpMethod;
|
||||
import org.springframework.http.MediaType;
|
||||
|
||||
|
||||
@@ -15,8 +15,6 @@
|
||||
*/
|
||||
package org.springframework.hateoas.mediatype.collectionjson;
|
||||
|
||||
import static com.fasterxml.jackson.annotation.JsonInclude.*;
|
||||
|
||||
import lombok.Value;
|
||||
import lombok.With;
|
||||
|
||||
@@ -26,6 +24,7 @@ import org.springframework.lang.Nullable;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude.Include;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
|
||||
/**
|
||||
|
||||
@@ -15,9 +15,8 @@
|
||||
*/
|
||||
package org.springframework.hateoas.mediatype.collectionjson;
|
||||
|
||||
import static org.springframework.hateoas.mediatype.collectionjson.Jackson2CollectionJsonModule.*;
|
||||
|
||||
import org.springframework.hateoas.CollectionModel;
|
||||
import org.springframework.hateoas.mediatype.collectionjson.Jackson2CollectionJsonModule.CollectionJsonResourcesDeserializer;
|
||||
|
||||
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
|
||||
|
||||
|
||||
@@ -15,9 +15,8 @@
|
||||
*/
|
||||
package org.springframework.hateoas.mediatype.collectionjson;
|
||||
|
||||
import static org.springframework.hateoas.mediatype.collectionjson.Jackson2CollectionJsonModule.*;
|
||||
|
||||
import org.springframework.hateoas.EntityModel;
|
||||
import org.springframework.hateoas.mediatype.collectionjson.Jackson2CollectionJsonModule.CollectionJsonResourceDeserializer;
|
||||
|
||||
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
|
||||
|
||||
|
||||
@@ -901,8 +901,8 @@ public class Jackson2CollectionJsonModule extends SimpleModule {
|
||||
static class CollectionJsonPagedResourcesDeserializer extends CollectionJsonDeserializerBase<PagedModel<?>> {
|
||||
|
||||
private static final long serialVersionUID = -7465448422501330790L;
|
||||
private static final BiFunction<List<Object>, Links, PagedModel<?>> FINISHER = (content,
|
||||
links) -> PagedModel.of(content, null, links);
|
||||
private static final BiFunction<List<Object>, Links, PagedModel<?>> FINISHER = (content, links) -> PagedModel
|
||||
.of(content, null, links);
|
||||
private static final Function<JavaType, CollectionJsonDeserializerBase<PagedModel<?>>> CONTEXTUAL_CREATOR = CollectionJsonPagedResourcesDeserializer::new;
|
||||
|
||||
CollectionJsonPagedResourcesDeserializer() {
|
||||
|
||||
@@ -15,9 +15,8 @@
|
||||
*/
|
||||
package org.springframework.hateoas.mediatype.collectionjson;
|
||||
|
||||
import static org.springframework.hateoas.mediatype.collectionjson.Jackson2CollectionJsonModule.*;
|
||||
|
||||
import org.springframework.hateoas.PagedModel;
|
||||
import org.springframework.hateoas.mediatype.collectionjson.Jackson2CollectionJsonModule.CollectionJsonPagedResourcesDeserializer;
|
||||
|
||||
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
|
||||
|
||||
|
||||
@@ -22,10 +22,10 @@ import java.util.List;
|
||||
import org.springframework.hateoas.AffordanceModel;
|
||||
import org.springframework.hateoas.AffordanceModel.InputPayloadMetadata;
|
||||
import org.springframework.hateoas.AffordanceModel.PayloadMetadata;
|
||||
import org.springframework.hateoas.mediatype.AffordanceModelFactory;
|
||||
import org.springframework.hateoas.Link;
|
||||
import org.springframework.hateoas.MediaTypes;
|
||||
import org.springframework.hateoas.QueryParameter;
|
||||
import org.springframework.hateoas.mediatype.AffordanceModelFactory;
|
||||
import org.springframework.http.HttpMethod;
|
||||
import org.springframework.http.MediaType;
|
||||
|
||||
|
||||
@@ -22,10 +22,10 @@ import java.util.List;
|
||||
import org.springframework.hateoas.AffordanceModel;
|
||||
import org.springframework.hateoas.AffordanceModel.InputPayloadMetadata;
|
||||
import org.springframework.hateoas.AffordanceModel.PayloadMetadata;
|
||||
import org.springframework.hateoas.mediatype.AffordanceModelFactory;
|
||||
import org.springframework.hateoas.Link;
|
||||
import org.springframework.hateoas.MediaTypes;
|
||||
import org.springframework.hateoas.QueryParameter;
|
||||
import org.springframework.hateoas.mediatype.AffordanceModelFactory;
|
||||
import org.springframework.http.HttpMethod;
|
||||
import org.springframework.http.MediaType;
|
||||
|
||||
|
||||
@@ -47,8 +47,7 @@ public interface ReactiveRepresentationModelAssembler<T, D extends Representatio
|
||||
* @param entities must not be {@literal null}.
|
||||
* @return {@link CollectionModel} containing {@code D}.
|
||||
*/
|
||||
default Mono<CollectionModel<D>> toCollectionModel(Flux<? extends T> entities,
|
||||
ServerWebExchange exchange) {
|
||||
default Mono<CollectionModel<D>> toCollectionModel(Flux<? extends T> entities, ServerWebExchange exchange) {
|
||||
|
||||
return entities.flatMap(entity -> toModel(entity, exchange)) //
|
||||
.collectList() //
|
||||
|
||||
@@ -62,8 +62,8 @@ public interface SimpleReactiveRepresentationModelAssembler<T>
|
||||
* @param entities must not be {@literal null}.
|
||||
* @return {@link CollectionModel} containing {@link EntityModel} of {@code T}.
|
||||
*/
|
||||
default Mono<CollectionModel<EntityModel<T>>> toCollectionModel(
|
||||
Flux<? extends T> entities, ServerWebExchange exchange) {
|
||||
default Mono<CollectionModel<EntityModel<T>>> toCollectionModel(Flux<? extends T> entities,
|
||||
ServerWebExchange exchange) {
|
||||
|
||||
return entities //
|
||||
.flatMap(entity -> toModel(entity, exchange)) //
|
||||
@@ -77,8 +77,8 @@ public interface SimpleReactiveRepresentationModelAssembler<T>
|
||||
*
|
||||
* @param resources
|
||||
*/
|
||||
default CollectionModel<EntityModel<T>> addLinks(
|
||||
CollectionModel<EntityModel<T>> resources, ServerWebExchange exchange) {
|
||||
default CollectionModel<EntityModel<T>> addLinks(CollectionModel<EntityModel<T>> resources,
|
||||
ServerWebExchange exchange) {
|
||||
return resources;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user