Class HalLinkRelation
java.lang.Object
org.springframework.hateoas.mediatype.hal.HalLinkRelation
- All Implemented Interfaces:
MessageSourceResolvable,LinkRelation
Value object for HAL based
LinkRelation, i.e. a relation that can be curied.- Author:
- Oliver Drotbohm
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceSimple builder interface to easily create multipleHalLinkRelations for a single curie. -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionCreates a newHalLinkRelationcuried to the given value.curieBuilder(String curie) Creates a newHalLinkRelation.HalLinkRelationBuilderfor the given curie.static HalLinkRelationCreates a newHalLinkRelationfor a curied relation.curieIfUncuried(String curie) Returns a curiedHalLinkRelationeither using the existing curie or the given one if previously uncuried.booleanString[]getCodes()inthashCode()booleanisCuried()Returns whether the link relation is curied.Returns a newLinkRelationwith its relation mapped by the given function, unless it is an IANA one.static HalLinkRelationof(LinkRelation relation) Returns aHalLinkRelationfor the given generalLinkRelation.toString()static HalLinkRelationCreates a new uncuriedHalLinkRelation.value()Return the link relation's value.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.springframework.hateoas.LinkRelation
isSameAsMethods inherited from interface org.springframework.context.MessageSourceResolvable
getArguments
-
Field Details
-
CURIES
-
-
Method Details
-
of
Returns aHalLinkRelationfor the given generalLinkRelation.- Parameters:
relation- must not be null.- Returns:
-
curied
Creates a newHalLinkRelationfor a curied relation.- Parameters:
curie- the curie, must not be null or empty.rel- the link relation to be used, must not be null.- Returns:
-
uncuried
Creates a new uncuriedHalLinkRelation.- Parameters:
rel- the link relation to be used, must not be null.- Returns:
-
curieBuilder
Creates a newHalLinkRelation.HalLinkRelationBuilderfor the given curie.- Parameters:
curie- must not be null or empty.- Returns:
- will never be null.
-
curie
Creates a newHalLinkRelationcuried to the given value.- Parameters:
curie- must not be null or empty.- Returns:
-
curieIfUncuried
Returns a curiedHalLinkRelationeither using the existing curie or the given one if previously uncuried.- Parameters:
curie- must not be null or empty.- Returns:
-
isCuried
public boolean isCuried()Returns whether the link relation is curied.- Returns:
-
map
Description copied from interface:LinkRelationReturns 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.- Specified by:
mapin interfaceLinkRelation- Parameters:
mapper- must not be null.- Returns:
- See Also:
-
value
Description copied from interface:LinkRelationReturn the link relation's value.- Specified by:
valuein interfaceLinkRelation
-
getCodes
- Specified by:
getCodesin interfaceMessageSourceResolvable
-
getDefaultMessage
- Specified by:
getDefaultMessagein interfaceMessageSourceResolvable
-
getLocalPart
-
equals
-
hashCode
public int hashCode() -
toString
-