abstract class Link extends Object
Class representing hypermedia links.
A hypermedia link may include additional
parameters beyond its underlying URI. Parameters such as rel or type
provide additional meta-data. Links in responses can be followed by
creating an javax.ws.rs.client.Invocation.Builder or a
javax.ws.rs.client.WebTarget.
The methods #toString() and #valueOf can be used to serialize
and de-serialize a link into a link header (RFC 5988).
| Modifier and Type | Class and Description |
|---|---|
static interface |
Link.Builder
Builder class for hypermedia links.
|
static class |
Link.JaxbLink
Value type for
javax.ws.rs.core.Link that can be marshalled and
unmarshalled by JAXB. |
| Modifier and Type | Field and Description |
|---|---|
static String |
REL
Rel link param from RFC 5988.
|
static String |
TITLE
Title link param from RFC 5988.
|
static String |
TYPE
Type link param from RFC 5988.
|
| Constructor and Description |
|---|
Link() |
| Modifier and Type | Method and Description |
|---|---|
abstract Map<String,String> |
getParams()
Returns an immutable map that includes all the link parameters
defined on this link.
|
abstract String |
getRel()
Returns the value associated with the link
rel param, or
null if this param is not specified. |
abstract List<String> |
getRels()
Returns the value associated with the link
rel param as a list
of strings or the empty list if rel is not defined. |
abstract String |
getTitle()
Returns the value associated with the link
title param, or
null if this param is not specified. |
abstract String |
getType()
Returns the value associated with the link
type param, or
null if this param is not specified. |
abstract URI |
getUri()
Returns the underlying URI associated with this link.
|
abstract BaseUriBuilder |
getUriBuilder()
Convenience method that returns a
javax.ws.rs.core.UriBuilder
initialized with this link's underlying URI. |
abstract String |
toString()
Returns a string representation as a link header (RFC 5988).
|
public static final String TITLE
public static final String REL
public static final String TYPE
public abstract URI getUri()
public abstract BaseUriBuilder getUriBuilder()
javax.ws.rs.core.UriBuilder
initialized with this link's underlying URI.public abstract String getRel()
rel param, or
null if this param is not specified.null.public abstract List<String> getRels()
rel param as a list
of strings or the empty list if rel is not defined.public abstract String getTitle()
title param, or
null if this param is not specified.null.public abstract String getType()
type param, or
null if this param is not specified.null.public abstract Map<String,String> getParams()
rel, title and type.public abstract String toString()
Copyright © 2014 Sven Strittmatter. All Rights Reserved.