Class TypedEntityLinks<T>
java.lang.Object
org.springframework.hateoas.server.TypedEntityLinks<T>
- Direct Known Subclasses:
TypedEntityLinks.ExtendedTypedEntityLinks
Entity links API to create
Links and LinkBuilder instances based on an identifier function.- Author:
- Oliver Drotbohm
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classExtension ofTypedEntityLinksthat exposes the ability to create links to collection resources as well. -
Method Summary
Modifier and TypeMethodDescriptionlinkForItemResource(T entity) Returns aLinkBuilderable to create links to the controller managing the given entity.linkToItemResource(T entity) Creates aLinkpointing to item resource backing the given entity.
-
Method Details
-
linkForItemResource
Returns aLinkBuilderable 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
LinkBuilderpointing 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 aLinkpointing 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
Linkpointing 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.
-