public class MapData extends ComplexData<MapData>
Constructor and Description |
---|
MapData(java.util.Map<java.lang.String,java.lang.Object> map) |
Modifier and Type | Method and Description |
---|---|
com.google.common.collect.ImmutableMap<java.lang.String,java.lang.Object> |
asMap()
Creates a map containing all the individual data points composing this complex data object.
|
boolean |
containsKey(java.lang.String key) |
boolean |
containsValue(java.lang.Object value) |
java.lang.Object |
get(java.lang.String key) |
boolean |
isEmpty() |
MapData |
put(java.lang.String key,
java.lang.Object value)
Creates a new MapData instance that is identical to this one, but with a new value for the given key.
|
java.lang.String |
toString() |
changesFrom
public com.google.common.collect.ImmutableMap<java.lang.String,java.lang.Object> asMap()
ComplexData
public class Point extends ComplexData<Point> {
private final double x;
private final double y;
}
should put the values of x
and y
into this map, with the keys "x"
and "y"
,
respectively. Note that these keys do not have to be the same as the field names, and may be completely arbitrary.
But the keys do have to be the same as those used by the corresponding ComplexDataType
to convert
a Map<String, Object>
to an instance of this class.asMap
in class ComplexData<MapData>
public java.lang.Object get(java.lang.String key)
public boolean isEmpty()
public boolean containsKey(java.lang.String key)
public boolean containsValue(java.lang.Object value)
public MapData put(java.lang.String key, java.lang.Object value)
key
- the key to setvalue
- the new value to putpublic java.lang.String toString()
toString
in class java.lang.Object