public class HalLinkRelation extends Object implements LinkRelation, MessageSourceResolvable
LinkRelation, i.e. a relation that can be curied.| Modifier and Type | Class and Description |
|---|---|
static interface |
HalLinkRelation.HalLinkRelationBuilder
Simple builder interface to easily create multiple
HalLinkRelations for a single curie. |
| Modifier and Type | Field and Description |
|---|---|
static HalLinkRelation |
CURIES |
| Modifier and Type | Method and Description |
|---|---|
HalLinkRelation |
curie(String curie)
Creates a new
HalLinkRelation curied to the given value. |
static HalLinkRelation.HalLinkRelationBuilder |
curieBuilder(String curie)
Creates a new
HalLinkRelation.HalLinkRelationBuilder for the given curie. |
static HalLinkRelation |
curied(String curie,
String rel)
Creates a new
HalLinkRelation for a curied relation. |
HalLinkRelation |
curieIfUncuried(String curie)
Returns a curied
HalLinkRelation either using the existing curie or the given one if previously uncuried. |
boolean |
equals(Object o) |
String[] |
getCodes() |
String |
getDefaultMessage() |
String |
getLocalPart() |
int |
hashCode() |
boolean |
isCuried()
Returns whether the link relation is curied.
|
HalLinkRelation |
map(Function<String,String> mapper)
Returns a new
LinkRelation with its relation mapped by the given function, unless it is an IANA one. |
static HalLinkRelation |
of(LinkRelation relation)
Returns a
HalLinkRelation for the given general LinkRelation. |
String |
toString() |
static HalLinkRelation |
uncuried(String rel)
Creates a new uncuried
HalLinkRelation. |
String |
value()
Return the link relation's value.
|
clone, finalize, getClass, notify, notifyAll, wait, wait, waitisSameAs, manyOfgetArgumentspublic static final HalLinkRelation CURIES
public static HalLinkRelation of(LinkRelation relation)
HalLinkRelation for the given general LinkRelation.relation - must not be null.public static HalLinkRelation curied(String curie, String rel)
HalLinkRelation for a curied relation.curie - the curie, must not be null or empty.rel - the link relation to be used, must not be null.public static HalLinkRelation uncuried(String rel)
HalLinkRelation.rel - the link relation to be used, must not be null.public static HalLinkRelation.HalLinkRelationBuilder curieBuilder(String curie)
HalLinkRelation.HalLinkRelationBuilder for the given curie.curie - must not be null or empty.public HalLinkRelation curie(String curie)
HalLinkRelation curied to the given value.curie - must not be null or empty.public HalLinkRelation curieIfUncuried(String curie)
HalLinkRelation either using the existing curie or the given one if previously uncuried.curie - must not be null or empty.public boolean isCuried()
public HalLinkRelation map(Function<String,String> mapper)
LinkRelationLinkRelation 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.map in interface LinkRelationmapper - must not be null.IanaLinkRelationspublic String value()
LinkRelationvalue in interface LinkRelation@NonNull public String[] getCodes()
getCodes in interface MessageSourceResolvable@NonNull public String getDefaultMessage()
getDefaultMessage in interface MessageSourceResolvablepublic String getLocalPart()
Copyright © 2011–2023 Pivotal, Inc.. All rights reserved.