Package org.springframework.hateoas
Class UriTemplate
java.lang.Object
org.springframework.hateoas.UriTemplate
- All Implemented Interfaces:
Serializable
,Iterable<TemplateVariable>
Custom URI template to support qualified URI template variables.
- Since:
- 0.9
- Author:
- Oliver Gierke, JamesE Richardson
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionExpands theUriTemplate
using the given parameters.Expands theUriTemplate
using the given parameters.Returns the names of the variables discovered.Returns theTemplateVariable
s discovered.static boolean
isTemplate
(String candidate) Returns whether the given candidate is a URI template.iterator()
static UriTemplate
Returns aUriTemplate
for the givenString
template.static UriTemplate
of
(String template, TemplateVariables variables) Returns aUriTemplate
for the givenString
template.toString()
with
(String variableName, TemplateVariable.VariableType type) Creates a newUriTemplate
with aTemplateVariable
with the given name and type added.with
(TemplateVariable variable) Creates a newUriTemplate
with the givenTemplateVariable
added.with
(TemplateVariables variables) Creates a newUriTemplate
with the currentTemplateVariable
s augmented with the given ones.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Method Details
-
of
Returns aUriTemplate
for the givenString
template.- Parameters:
template
- must not be null or empty.- Returns:
-
of
Returns aUriTemplate
for the givenString
template.- Parameters:
template
- must not be null or empty.- Returns:
-
with
Creates a newUriTemplate
with the currentTemplateVariable
s augmented with the given ones.- Parameters:
variables
- must not be null.- Returns:
- will never be null.
-
with
Creates a newUriTemplate
with the givenTemplateVariable
added.- Parameters:
variable
- must not be null.- Returns:
- will never be null.
-
with
Creates a newUriTemplate
with aTemplateVariable
with the given name and type added.- Parameters:
variableName
- must not be null or empty.type
- must not be null.- Returns:
- will never be null.
-
isTemplate
Returns whether the given candidate is a URI template.- Parameters:
candidate
-- Returns:
-
getVariables
Returns theTemplateVariable
s discovered.- Returns:
-
getVariableNames
Returns the names of the variables discovered.- Returns:
-
expand
Expands theUriTemplate
using the given parameters. The values will be applied in the order of the variables discovered.- Parameters:
parameters
-- Returns:
- See Also:
-
expand
Expands theUriTemplate
using the given parameters.- Parameters:
parameters
- must not be null.- Returns:
-
iterator
- Specified by:
iterator
in interfaceIterable<TemplateVariable>
-
toString
-