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
HalLinkRelation s for a single curie. |
Modifier and Type | Field and Description |
---|---|
static HalLinkRelation |
CURIES |
Constructor and Description |
---|
HalLinkRelation() |
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. |
String[] |
getCodes() |
String |
getDefaultMessage() |
boolean |
isCuried()
Returns whether the link relation is curied.
|
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, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
isSameAs, manyOf
getArguments
public 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 String value()
LinkRelation
value
in interface LinkRelation
@NonNull public String[] getCodes()
getCodes
in interface MessageSourceResolvable
@NonNull public String getDefaultMessage()
getDefaultMessage
in interface MessageSourceResolvable
Copyright © 2011–2020 Pivotal, Inc.. All rights reserved.