public final class TemplateVariable extends Object implements Serializable
Modifier and Type | Class and Description |
---|---|
static class |
TemplateVariable.Cardinality
The cardinality of the
TemplateVariable . |
static class |
TemplateVariable.VariableType
An enumeration for all supported variable types.
|
Constructor and Description |
---|
TemplateVariable(String name,
TemplateVariable.VariableType type)
Creates a new
TemplateVariable with the given name and type. |
TemplateVariable(String name,
TemplateVariable.VariableType type,
String description) |
Modifier and Type | Method and Description |
---|---|
String |
asString() |
TemplateVariable |
composite()
Marks the current template variable as composite value.
|
static TemplateVariable |
compositeParameter(String parameter)
Deprecated.
since 1.4, use actual parameter type and call
composite() on the instance instead. |
boolean |
equals(Object o) |
String |
expand(Map<String,?> parameters) |
static TemplateVariable |
fragment(String name)
Static helper to fashion
TemplateVariable.VariableType.FRAGMENT variables. |
String |
getDescription() |
String |
getName() |
TemplateVariable.VariableType |
getType()
Returns the type of the
TemplateVariable . |
boolean |
hasDescription()
Returns whether the variable has a description.
|
int |
hashCode() |
boolean |
isComposite()
Returns whether the current
TemplateVariable is a composite one. |
boolean |
isSingular()
Returns whether the current
TemplateVariable is a singular one. |
TemplateVariable |
limit(int limit) |
static TemplateVariable |
pathVariable(String variable)
Static helper to fashion
TemplateVariable.VariableType.PATH_VARIABLE variables. |
String |
prepareAndEncode(Object value) |
static TemplateVariable |
requestParameter(String parameter)
Static helper to fashion
TemplateVariable.VariableType.REQUEST_PARAM variables. |
static TemplateVariable |
requestParameterContinued(String parameter)
Static helper to fashion
TemplateVariable.VariableType.REQUEST_PARAM_CONTINUED variables. |
static TemplateVariable |
reservedString(String name) |
static TemplateVariable |
segment(String segment)
Static helper to fashion
TemplateVariable.VariableType.SEGMENT variables. |
TemplateVariable |
singular()
Marks the current template variable as singular value.
|
String |
toString() |
public TemplateVariable(String name, TemplateVariable.VariableType type)
TemplateVariable
with the given name and type.name
- must not be null or empty.type
- must not be null.public TemplateVariable(String name, TemplateVariable.VariableType type, String description)
public static TemplateVariable pathVariable(String variable)
TemplateVariable.VariableType.PATH_VARIABLE
variables.variable
- must not be null or empty.public static TemplateVariable requestParameter(String parameter)
TemplateVariable.VariableType.REQUEST_PARAM
variables.parameter
- must not be null or empty.public static TemplateVariable requestParameterContinued(String parameter)
TemplateVariable.VariableType.REQUEST_PARAM_CONTINUED
variables.parameter
- must not be null or empty.public static TemplateVariable segment(String segment)
TemplateVariable.VariableType.SEGMENT
variables.segment
- must not be null or empty.public static TemplateVariable fragment(String name)
TemplateVariable.VariableType.FRAGMENT
variables.name
- must not be null or empty.public static TemplateVariable reservedString(String name)
@Deprecated public static TemplateVariable compositeParameter(String parameter)
composite()
on the instance instead.TemplateVariable.VariableType.COMPOSITE_PARAM
variables.parameter
- must not be null or empty.public TemplateVariable composite()
public TemplateVariable singular()
public TemplateVariable limit(int limit)
public boolean isComposite()
TemplateVariable
is a composite one.public boolean isSingular()
TemplateVariable
is a singular one.public boolean hasDescription()
public String asString()
public String getName()
public TemplateVariable.VariableType getType()
TemplateVariable
.public String getDescription()
Copyright © 2011–2021 Pivotal, Inc.. All rights reserved.