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 TypeMethodDescriptionvoidaddLinks(CollectionModel<EntityModel<T>> resources) Define links to add to theCollectionModelcollection.voidaddLinks(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:
toModelin 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:
toCollectionModelin interfaceRepresentationModelAssembler<T,EntityModel<T>> - Parameters:
entities- must not be null.- Returns:
CollectionModelcontainingEntityModelofT.- See Also:
-
addLinks
Define links to add to theCollectionModelcollection.- Parameters:
resources-
-