public final class Links extends Object
{
"simple": { "href": "/uri" },
"multiple": [ { "href": "/uri1" }, { "href": "/uri2" } ],
"withContentType": { "href": "/uri", "type": "text/html" },
"isATemplate": { "href": "/uri/{var}", "templated": true }
}
| Modifier and Type | Field and Description |
|---|---|
static String |
REST_TYPE |
static String |
WEB_TYPE |
| Constructor and Description |
|---|
Links(Map<String,com.google.common.collect.ImmutableList<Link>> items) |
| Modifier and Type | Method and Description |
|---|---|
Map<String,com.google.common.collect.ImmutableList<Link>> |
getItems()
Used internally.
|
com.atlassian.fugue.Option<Link> |
getLink(String rel)
Returns the first
Link matching the given key, if any. |
com.atlassian.fugue.Option<Link> |
getLink(String rel,
String contentType)
Returns the first
Link matching the given key and the given content type, if any. |
Iterable<Link> |
getLinks(String rel)
Returns every
Link that matches the given key. |
com.atlassian.fugue.Option<URI> |
getUri(String rel)
Shortcut for getting the URI of the first
Link that matches the given key. |
com.atlassian.fugue.Option<URI> |
getUri(String rel,
String contentType)
Shortcut for getting the URI of the first
Link that matches the given key and content type. |
com.atlassian.fugue.Option<UriTemplate> |
getUriTemplate(String rel)
Shortcut for getting the template of the first
Link that matches the given key,
if it is a template. |
com.atlassian.fugue.Option<UriTemplate> |
getUriTemplate(String rel,
String contentType)
Shortcut for getting the template of the first
Link that matches the given key
and content type, if it is a template. |
public static final String REST_TYPE
public static final String WEB_TYPE
public Map<String,com.google.common.collect.ImmutableList<Link>> getItems()
public com.atlassian.fugue.Option<Link> getLink(String rel)
Link matching the given key, if any.public com.atlassian.fugue.Option<Link> getLink(String rel, String contentType)
Link matching the given key and the given content type, if any.public com.atlassian.fugue.Option<URI> getUri(String rel)
Link that matches the given key.public com.atlassian.fugue.Option<URI> getUri(String rel, String contentType)
Link that matches the given key and content type.public com.atlassian.fugue.Option<UriTemplate> getUriTemplate(String rel)
Link that matches the given key,
if it is a template.public com.atlassian.fugue.Option<UriTemplate> getUriTemplate(String rel, String contentType)
Link that matches the given key
and content type, if it is a template.Copyright © 2016 Atlassian. All rights reserved.