Package org.springframework.hateoas
Interface LinkRelation
- All Known Implementing Classes:
HalLinkRelation
public interface LinkRelation
Interface for defining link relations. Can be used for implementing spec-based link relations as well as custom ones.
- Since:
- 1.0
- Author:
- Greg Turnquist, Oliver Drotbohm
-
Method Summary
Modifier and TypeMethodDescriptiondefault booleanisSameAs(LinkRelation relation) Returns whether the givenLinkRelationis logically the same as the current one, independent of implementation, i.e. whether the plainStringvalues match.static Iterable<LinkRelation>default LinkRelationReturns a newLinkRelationwith its relation mapped by the given function, unless it is an IANA one.static LinkRelationCreates a newLinkRelation.value()Return the link relation's value.
-
Method Details
-
value
String value()Return the link relation's value. -
of
Creates a newLinkRelation.- Parameters:
relation- must not be null or empty.- Returns:
-
manyOf
- Parameters:
others- must not be null.- Returns:
-
isSameAs
Returns whether the givenLinkRelationis logically the same as the current one, independent of implementation, i.e. whether the plainStringvalues match.- Parameters:
relation- must not be null.- Returns:
-
map
Returns a newLinkRelationwith its relation mapped by the given function, unless it is an IANA one. Implementors are encouraged to override this method to redeclare the return type to be itself.- Parameters:
mapper- must not be null.- Returns:
- See Also:
-