|
Spring Hateoas | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.springframework.hateoas.Link
public class Link
Value object for links.
| Field Summary | |
|---|---|
static String |
ATOM_NAMESPACE
|
static String |
REL_FIRST
|
static String |
REL_LAST
|
static String |
REL_NEXT
|
static String |
REL_PREVIOUS
|
static String |
REL_SELF
|
| Constructor Summary | |
|---|---|
protected |
Link()
Empty constructor required by the marshalling framework. |
|
Link(String href)
Creates a new link to the given URI with the self rel. |
|
Link(String href,
String rel)
Creates a new Link to the given URI with the given rel. |
|
Link(UriTemplate template,
String rel)
Creates a new Link from the given UriTemplate and rel. |
| Method Summary | |
|---|---|
boolean |
equals(Object obj)
|
Link |
expand(Map<String,? extends Object> arguments)
Turns the current template into a Link by expanding it using the given parameters. |
Link |
expand(Object... arguments)
Turns the current template into a Link by expanding it using the given parameters. |
String |
getHref()
Returns the actual URI the link is pointing to. |
String |
getRel()
Returns the rel of the link. |
List<String> |
getVariableNames()
Returns the variable names contained in the template. |
List<TemplateVariable> |
getVariables()
Returns all TemplateVariables contained in the Link. |
int |
hashCode()
|
boolean |
isTemplated()
Returns whether the link is templated. |
String |
toString()
|
static Link |
valueOf(String element)
Factory method to easily create Link instances from RFC-5988 compatible String representations of a
link. |
Link |
withRel(String rel)
Returns a Link pointing to the same URI but with the given relation. |
Link |
withSelfRel()
Returns a Link pointing to the same URI but with the self relation. |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final String ATOM_NAMESPACE
public static final String REL_SELF
public static final String REL_FIRST
public static final String REL_PREVIOUS
public static final String REL_NEXT
public static final String REL_LAST
| Constructor Detail |
|---|
public Link(String href)
href - must not be null or empty.REL_SELF
public Link(String href,
String rel)
Link to the given URI with the given rel.
href - must not be null or empty.rel - must not be null or empty.
public Link(UriTemplate template,
String rel)
UriTemplate and rel.
template - must not be null.rel - must not be null or empty.protected Link()
| Method Detail |
|---|
public String getHref()
public String getRel()
public Link withRel(String rel)
Link pointing to the same URI but with the given relation.
rel - must not be null or empty.
public Link withSelfRel()
Link pointing to the same URI but with the self relation.
public List<String> getVariableNames()
public List<TemplateVariable> getVariables()
TemplateVariables contained in the Link.
public boolean isTemplated()
public Link expand(Object... arguments)
Link by expanding it using the given parameters.
arguments -
public Link expand(Map<String,? extends Object> arguments)
Link by expanding it using the given parameters.
arguments - must not be null.
public boolean equals(Object obj)
equals in class Objectpublic int hashCode()
hashCode in class Objectpublic String toString()
toString in class Objectpublic static Link valueOf(String element)
Link instances from RFC-5988 compatible String representations of a
link. Will return null if an empty or null String is given.
element - an RFC-5899 compatible representation of a link.
IllegalArgumentException - if a non-empty String was given that does not adhere to RFC-5899.
IllegalArgumentException - if no rel attribute could be found.
|
Spring Hateoas | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||