Interface SimpleReactiveRepresentationModelAssembler<T>
- All Superinterfaces:
ReactiveRepresentationModelAssembler<T,
EntityModel<T>>
public interface SimpleReactiveRepresentationModelAssembler<T>
extends ReactiveRepresentationModelAssembler<T,EntityModel<T>>
Reactive variant of
RepresentationModelAssembler
combined with SimpleRepresentationModelAssembler
.- Author:
- Greg Turnquist, Oliver Drotbohm
-
Method Summary
Modifier and TypeMethodDescriptiondefault CollectionModel<EntityModel<T>>
addLinks
(CollectionModel<EntityModel<T>> resources, ServerWebExchange exchange) Define links to add to theCollectionModel
collection.default EntityModel<T>
addLinks
(EntityModel<T> resource, ServerWebExchange exchange) Define links to add to every individualEntityModel
.default reactor.core.publisher.Mono<CollectionModel<EntityModel<T>>>
toCollectionModel
(reactor.core.publisher.Flux<? extends T> entities, ServerWebExchange exchange) Converts all given entities into resources and wraps the collection as a resource as well.default reactor.core.publisher.Mono<EntityModel<T>>
toModel
(T entity, ServerWebExchange exchange) Converts the given entity into aEntityModel
wrapped in aMono
.
-
Method Details
-
toModel
Converts the given entity into aEntityModel
wrapped in aMono
.- Specified by:
toModel
in interfaceReactiveRepresentationModelAssembler<T,
EntityModel<T>> - Parameters:
entity
- must not be null.exchange
- must not be null.- Returns:
- will never be null.
-
addLinks
Define links to add to every individualEntityModel
.- Parameters:
resource
- must not be null.exchange
- must not be null.- Returns:
- will never be null.
-
toCollectionModel
default reactor.core.publisher.Mono<CollectionModel<EntityModel<T>>> toCollectionModel(reactor.core.publisher.Flux<? extends T> entities, ServerWebExchange exchange) Converts all given entities into resources and wraps the collection as a resource as well.- Specified by:
toCollectionModel
in interfaceReactiveRepresentationModelAssembler<T,
EntityModel<T>> - Parameters:
entities
- must not be null.- Returns:
CollectionModel
containingEntityModel
ofT
, will never be null..- See Also:
-
addLinks
default CollectionModel<EntityModel<T>> addLinks(CollectionModel<EntityModel<T>> resources, ServerWebExchange exchange) Define links to add to theCollectionModel
collection.- Parameters:
resources
- must not be null.- Returns:
- will never be null.
-