Class TypedEntityLinks<T>
java.lang.Object
org.springframework.hateoas.server.TypedEntityLinks<T>
- Direct Known Subclasses:
TypedEntityLinks.ExtendedTypedEntityLinks
Entity links API to create
Link
s and LinkBuilder
instances based on an identifier function.- Author:
- Oliver Drotbohm
- See Also:
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Extension ofTypedEntityLinks
that exposes the ability to create links to collection resources as well. -
Method Summary
Modifier and TypeMethodDescriptionlinkForItemResource
(T entity) Returns aLinkBuilder
able to create links to the controller managing the given entity.linkToItemResource
(T entity) Creates aLink
pointing to item resource backing the given entity.
-
Method Details
-
linkForItemResource
Returns aLinkBuilder
able to create links to the controller managing the given entity. Implementations will know about the URI structure being used to expose item-resource URIs.- Parameters:
entity
- the entity to point to, must not be null.- Returns:
- the
LinkBuilder
pointing to the item resource identified by the given entity. Will never be null. - Throws:
IllegalArgumentException
- in case the given type is unknown the entity links infrastructure.
-
linkToItemResource
Creates aLink
pointing to item resource backing the given entity. The relation type of the link will be determined by the implementation class and should be defaulted toIanaLinkRelations.SELF
.- Parameters:
entity
- the entity to point to, must not be null.- Returns:
- the
Link
pointing to the resource exposed for the given entity. Will never be null. - Throws:
IllegalArgumentException
- in case the given type is unknown the entity links infrastructure.
-