Modifier and Type | Method and Description |
---|---|
Link.Builder |
baseUri(java.lang.String uri)
Set the base URI as a string for resolution of relative URIs.
|
Link.Builder |
baseUri(java.net.URI uri)
Set the base URI for resolution of relative URIs.
|
Link |
build(java.lang.Object... values)
Finish building this link using the supplied values as URI parameters.
|
Link |
buildRelativized(java.net.URI uri,
java.lang.Object... values)
Finish building this link using the supplied values as URI parameters
and relativize the result with respect to the supplied URI.
|
Link.Builder |
link(Link link)
Initialize builder using another link.
|
Link.Builder |
link(java.lang.String link)
Initialize builder using another link represented as a string.
|
Link.Builder |
param(java.lang.String name,
java.lang.String value)
Set an arbitrary parameter on this link.
|
Link.Builder |
rel(java.lang.String rel)
Convenience method to set a link relation.
|
Link.Builder |
title(java.lang.String title)
Convenience method to set a
title on this link. |
Link.Builder |
type(java.lang.String type)
Convenience method to set a
type on this link. |
Link.Builder |
uri(java.lang.String uri)
Set underlying string representing URI template for the link being constructed.
|
Link.Builder |
uri(java.net.URI uri)
Set underlying URI template for the link being constructed.
|
Link.Builder |
uriBuilder(UriBuilder uriBuilder)
Set underlying URI builder representing the URI template for the link being constructed.
|
Link.Builder link(Link link)
link
- other link from which to initialize.Link.Builder link(java.lang.String link)
link ::= '<' uri '>' (';' link-param)* link-param ::= name '=' quoted-stringSee RFC 5988 for more information.
link
- other link in string representation.java.lang.IllegalArgumentException
- if string representation of URI is invalid.Link.Builder uri(java.net.URI uri)
uri
- underlying URI for linkLink.Builder uri(java.lang.String uri)
uri
- underlying URI for link.java.lang.IllegalArgumentException
- if string representation of URI is invalid.Link.Builder baseUri(java.net.URI uri)
uri
- base URI for relative links.Link.fromPath(java.lang.String)
,
Link.fromResource(java.lang.Class)
,
Link.fromMethod(java.lang.Class, java.lang.String)
Link.Builder baseUri(java.lang.String uri)
uri
- base URI for relative links.java.lang.IllegalArgumentException
- if string representation of URI is invalid.Link.fromPath(java.lang.String)
,
Link.fromResource(java.lang.Class)
,
Link.fromMethod(java.lang.Class, java.lang.String)
Link.Builder uriBuilder(UriBuilder uriBuilder)
uriBuilder
- underlying URI builder.Link.Builder rel(java.lang.String rel)
rel
value can
be specified by using one or more whitespace characters as delimiters
according to RFC 5988. The effect of calling this method is cumulative;
relations are appended using a single space character as separator.rel
- relation name.java.lang.IllegalArgumentException
- if the name is null
.Link.Builder title(java.lang.String title)
title
on this link.title
- title parameter of this link.java.lang.IllegalArgumentException
- if the title is null
.Link.Builder type(java.lang.String type)
type
on this link.type
- type parameter of this link.java.lang.IllegalArgumentException
- if the type is null
.Link.Builder param(java.lang.String name, java.lang.String value)
build(Object...)
.name
- the name of the parameter.value
- the value set for the parameter.java.lang.IllegalArgumentException
- if either the name or value are null
.Link build(java.lang.Object... values)
values
- parameters used to build underlying URI.java.lang.IllegalArgumentException
- if there are any URI template parameters
without a supplied value, or if a value is null
.UriBuilderException
- if a URI cannot be constructed based on the
current state of the underlying URI builder.Link buildRelativized(java.net.URI uri, java.lang.Object... values)
build(java.lang.Object[])
. Note that a base URI can
be set on a relative link using baseUri(java.net.URI)
.
The state of the builder is unaffected; this method may be called
multiple times on the same builder instance.uri
- URI used for relativization.values
- parameters used to build underlying URI.java.lang.IllegalArgumentException
- if there are any URI template parameters
without a supplied value, or if a value is null
.UriBuilderException
- if a URI cannot be constructed based on the current
state of the underlying URI builder.baseUri(java.lang.String)
,
baseUri(java.net.URI)