@Immutable public final class MapValue extends VariableValue
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()).
| Modifier and Type | Class and Description |
|---|---|
static class |
MapValue.Builder
Builder class for a
MapValue |
BUNDLE| Modifier and Type | Method and Description |
|---|---|
static <T> VariableValue |
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
|
getListValue, getScalarValue, getTypepublic static MapValue.Builder newBuilder()
MapValue.Builderpublic static <T> VariableValue copyOf(Map<String,T> map)
MapT - the type of values in this mapmap - the mapVariableValueNullPointerException - map is null, or one of its keys or values
is nullpublic Map<String,String> getMapValue()
VariableValueOnly valid for map values
getMapValue in class VariableValuepublic boolean isEmpty()
VariableValueFor 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