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 boolean
isSameAs
(LinkRelation relation) Returns whether the givenLinkRelation
is logically the same as the current one, independent of implementation, i.e. whether the plainString
values match.static Iterable<LinkRelation>
default LinkRelation
Returns a newLinkRelation
with its relation mapped by the given function, unless it is an IANA one.static LinkRelation
Creates 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 givenLinkRelation
is logically the same as the current one, independent of implementation, i.e. whether the plainString
values match.- Parameters:
relation
- must not be null.- Returns:
-
map
Returns a newLinkRelation
with 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:
-