com.github.fge.uritemplate.vars
Class VariableMap

java.lang.Object
  extended by com.github.fge.uritemplate.vars.VariableMap
All Implemented Interfaces:
com.github.fge.Frozen<VariableMapBuilder>

@Immutable
public final class VariableMap
extends Object
implements com.github.fge.Frozen<VariableMapBuilder>

Container class for variables name/value pairs

You must use a builder for building an instance of this class, using the newBuilder() method.

Note that this class uses the freeze/thaw pattern. You can therefore "thaw" an instance of this class in order to obtain a builder again.

See Also:
VariableMapBuilder, URITemplate.toString(VariableMap), URITemplate.toURI(VariableMap), URITemplate.toURL(VariableMap)

Method Summary
 VariableValue get(String varname)
          Get the value associated with a variable name
static VariableMapBuilder newBuilder()
          Create a new builder for this class
 VariableMapBuilder thaw()
          Return a thawed version of this instance
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

newBuilder

public static VariableMapBuilder newBuilder()
Create a new builder for this class

Returns:
a VariableMapBuilder

get

public VariableValue get(String varname)
Get the value associated with a variable name

Parameters:
varname - the variable name
Returns:
the value, or null if there is no matching value

thaw

public VariableMapBuilder thaw()
Return a thawed version of this instance

Specified by:
thaw in interface com.github.fge.Frozen<VariableMapBuilder>
Returns:
a VariableMapBuilder filled with name/value pairs of this instance