Interface SimpleRepresentationModelAssembler<T>
- All Superinterfaces:
RepresentationModelAssembler<T,
EntityModel<T>>
public interface SimpleRepresentationModelAssembler<T>
extends RepresentationModelAssembler<T,EntityModel<T>>
A
RepresentationModelAssembler
based purely on the domain type, using EntityRepresentationModel<T>
as
the enclosing representation model type.- Since:
- 1.0
- Author:
- Greg Turnquist
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addLinks
(CollectionModel<EntityModel<T>> resources) Define links to add to theCollectionModel
collection.void
addLinks
(EntityModel<T> resource) Define links to add to every individualEntityModel
.default CollectionModel<EntityModel<T>>
toCollectionModel
(Iterable<? extends T> entities) Converts all given entities into resources and wraps the collection as a resource as well.default EntityModel<T>
Converts the given entity into aEntityModel
.
-
Method Details
-
toModel
Converts the given entity into aEntityModel
.- Specified by:
toModel
in interfaceRepresentationModelAssembler<T,
EntityModel<T>> - Parameters:
entity
-- Returns:
-
addLinks
Define links to add to every individualEntityModel
.- Parameters:
resource
-
-
toCollectionModel
Converts all given entities into resources and wraps the collection as a resource as well.- Specified by:
toCollectionModel
in interfaceRepresentationModelAssembler<T,
EntityModel<T>> - Parameters:
entities
- must not be null.- Returns:
CollectionModel
containingEntityModel
ofT
.- See Also:
-
addLinks
Define links to add to theCollectionModel
collection.- Parameters:
resources
-
-