|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.github.fge.uritemplate.vars.values.VariableValue
com.github.fge.uritemplate.vars.values.MapValue
@Immutable public final class MapValue
Map variable value
Note that some methods allow to pass values of arbitrary type. It is the
caller's responsibility to ensure that these values have a correct .toString()
implementation.
Also note that null keys or values are not accepted.
While there is one public constructor, it is deprecated. Use copyOf(Map)
instead, or for more control, use a MapValue.Builder
(see
newBuilder()
).
Nested Class Summary | |
---|---|
static class |
MapValue.Builder
Builder class for a MapValue |
Field Summary |
---|
Fields inherited from class com.github.fge.uritemplate.vars.values.VariableValue |
---|
BUNDLE |
Method Summary | ||
---|---|---|
static
|
copyOf(Map<String,T> map)
Convenience method to build a variable value from an existing Map |
|
Map<String,String> |
getMapValue()
Get a map for this value |
|
boolean |
isEmpty()
Tell whether this value is empty |
|
static MapValue.Builder |
newBuilder()
Create a new builder for this class |
Methods inherited from class com.github.fge.uritemplate.vars.values.VariableValue |
---|
getListValue, getScalarValue, getType |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static MapValue.Builder newBuilder()
MapValue.Builder
public static <T> VariableValue copyOf(Map<String,T> map)
Map
T
- the type of values in this mapmap
- the map
VariableValue
NullPointerException
- map is null, or one of its keys or values
is nullpublic Map<String,String> getMapValue()
VariableValue
Only valid for map values
getMapValue
in class VariableValue
public boolean isEmpty()
VariableValue
For strings, this tells whether the string itself is empty. For lists and maps, this tells whether the list or map have no elements/entries.
isEmpty
in class VariableValue
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |