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 theUriTemplateusing the given parameters.Expands theUriTemplateusing the given parameters.Returns the names of the variables discovered.Returns theTemplateVariables discovered.static booleanisTemplate(String candidate) Returns whether the given candidate is a URI template.iterator()static UriTemplateReturns aUriTemplatefor the givenStringtemplate.static UriTemplateof(String template, TemplateVariables variables) Returns aUriTemplatefor the givenStringtemplate.toString()with(String variableName, TemplateVariable.VariableType type) Creates a newUriTemplatewith aTemplateVariablewith the given name and type added.with(TemplateVariable variable) Creates a newUriTemplatewith the givenTemplateVariableadded.with(TemplateVariables variables) Creates a newUriTemplatewith the currentTemplateVariables augmented with the given ones.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Method Details
-
of
Returns aUriTemplatefor the givenStringtemplate.- Parameters:
template- must not be null or empty.- Returns:
-
of
Returns aUriTemplatefor the givenStringtemplate.- Parameters:
template- must not be null or empty.- Returns:
-
with
Creates a newUriTemplatewith the currentTemplateVariables augmented with the given ones.- Parameters:
variables- must not be null.- Returns:
- will never be null.
-
with
Creates a newUriTemplatewith the givenTemplateVariableadded.- Parameters:
variable- must not be null.- Returns:
- will never be null.
-
with
Creates a newUriTemplatewith aTemplateVariablewith 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 theTemplateVariables discovered.- Returns:
-
getVariableNames
Returns the names of the variables discovered.- Returns:
-
expand
Expands theUriTemplateusing the given parameters. The values will be applied in the order of the variables discovered.- Parameters:
parameters-- Returns:
- See Also:
-
expand
Expands theUriTemplateusing the given parameters.- Parameters:
parameters- must not be null.- Returns:
-
iterator
- Specified by:
iteratorin interfaceIterable<TemplateVariable>
-
toString
-