public class UriTemplate extends Object implements Iterable<TemplateVariable>, Serializable
https://tools.ietf.org/html/rfc6570,
Serialized Form| Modifier and Type | Method and Description |
|---|---|
URI |
expand(Map<String,?> parameters)
Expands the
UriTemplate using the given parameters. |
URI |
expand(Object... parameters)
Expands the
UriTemplate using the given parameters. |
List<String> |
getVariableNames()
Returns the names of the variables discovered.
|
List<TemplateVariable> |
getVariables()
Returns the
TemplateVariables discovered. |
static boolean |
isTemplate(String candidate)
Returns whether the given candidate is a URI template.
|
Iterator<TemplateVariable> |
iterator() |
static UriTemplate |
of(String template)
Returns a
UriTemplate for the given String template. |
static UriTemplate |
of(String template,
TemplateVariables variables)
Returns a
UriTemplate for the given String template. |
String |
toString() |
UriTemplate |
with(String variableName,
TemplateVariable.VariableType type)
Creates a new
UriTemplate with a TemplateVariable with the given name and type added. |
UriTemplate |
with(TemplateVariable variable)
Creates a new
UriTemplate with the given TemplateVariable added. |
UriTemplate |
with(TemplateVariables variables)
Creates a new
UriTemplate with the current TemplateVariables augmented with the given ones. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitforEach, spliteratorpublic static UriTemplate of(String template)
UriTemplate for the given String template.template - must not be null or empty.public static UriTemplate of(String template, TemplateVariables variables)
UriTemplate for the given String template.template - must not be null or empty.public UriTemplate with(TemplateVariables variables)
UriTemplate with the current TemplateVariables augmented with the given ones.variables - must not be null.public UriTemplate with(TemplateVariable variable)
UriTemplate with the given TemplateVariable added.variable - must not be null.public UriTemplate with(String variableName, TemplateVariable.VariableType type)
UriTemplate with a TemplateVariable with the given name and type added.variableName - must not be null or empty.type - must not be null.public static boolean isTemplate(String candidate)
candidate - public List<TemplateVariable> getVariables()
TemplateVariables discovered.public List<String> getVariableNames()
public URI expand(Object... parameters)
UriTemplate using the given parameters. The values will be applied in the order of the
variables discovered.parameters - expand(Map)public URI expand(Map<String,?> parameters)
UriTemplate using the given parameters.parameters - must not be null.public Iterator<TemplateVariable> iterator()
iterator in interface Iterable<TemplateVariable>Copyright © 2011–2023 Pivotal, Inc.. All rights reserved.