private class Variable.MapValueAccessor extends Variable.AbstractValueAccessor implements MapValue
| Modifier | Constructor and Description |
|---|---|
private |
MapValueAccessor() |
| Modifier and Type | Method and Description |
|---|---|
MapValue |
asMapValue()
Returns the value as
MapValue. |
java.util.Set<java.util.Map.Entry<Value,Value>> |
entrySet() |
Value[] |
getKeyValueArray()
Returns the key-value pairs as an array of
Value. |
ValueType |
getValueType()
Returns type of this value.
|
ImmutableMapValue |
immutableValue()
Returns immutable copy of this value.
|
java.util.Set<Value> |
keySet() |
java.util.Map<Value,Value> |
map()
Returns the value as
Map. |
int |
size()
Returns number of key-value pairs in this array.
|
java.util.Collection<Value> |
values() |
void |
writeTo(MessagePacker pk)
Serializes the value using the specified
MessagePacker |
asArrayValue, asBinaryValue, asBooleanValue, asExtensionValue, asFloatValue, asIntegerValue, asNilValue, asNumberValue, asRawValue, asStringValue, asTimestampValue, equals, hashCode, isArrayValue, isBinaryValue, isBooleanValue, isExtensionValue, isFloatValue, isIntegerValue, isMapValue, isNilValue, isNumberValue, isRawValue, isStringValue, isTimestampValue, toJson, toStringclone, finalize, getClass, notify, notifyAll, wait, wait, waitasArrayValue, asBinaryValue, asBooleanValue, asExtensionValue, asFloatValue, asIntegerValue, asNilValue, asNumberValue, asRawValue, asStringValue, asTimestampValue, equals, isArrayValue, isBinaryValue, isBooleanValue, isExtensionValue, isFloatValue, isIntegerValue, isMapValue, isNilValue, isNumberValue, isRawValue, isStringValue, isTimestampValue, toJsonpublic ValueType getValueType()
Valueinstanceof to check type of a value because type of a mutable value is variable.getValueType in interface Valuepublic MapValue asMapValue()
ValueMapValue. Otherwise throws MessageTypeCastException.
Note that you can't use instanceof or cast ((MapValue) thisValue) to check type of a value because type of a mutable value is variable.asMapValue in interface ValueasMapValue in class Variable.AbstractValueAccessorpublic ImmutableMapValue immutableValue()
Valuethis without copying the value if this value is already immutable.immutableValue in interface Valuepublic int size()
MapValuepublic Value[] getKeyValueArray()
MapValueValue.
Odd elements are keys. Next element of an odd element is a value corresponding to the key.
For example, if this value represents {"k1": "v1", "k2": "v2"}, this method returns ["k1", "v1", "k2", "v2"].getKeyValueArray in interface MapValuepublic java.util.Map<Value,Value> map()
MapValueMap.public void writeTo(MessagePacker pk) throws java.io.IOException
ValueMessagePackerwriteTo in interface Valuejava.io.IOExceptionMessagePacker