-
- All Implemented Interfaces:
-
com.batch.android.msgpack.value.ExtensionValue,com.batch.android.msgpack.value.ImmutableExtensionValue,com.batch.android.msgpack.value.ImmutableValue,com.batch.android.msgpack.value.Value
public class ImmutableExtensionValueImpl extends AbstractImmutableValue implements ImmutableExtensionValue
{@code ImmutableExtensionValueImpl}Implements{@code ImmutableExtensionValue}using a{@code byte}and a{@code byte[]}fields.
-
-
Constructor Summary
Constructors Constructor Description ImmutableExtensionValueImpl(byte type, Array<byte> data)
-
Method Summary
Modifier and Type Method Description bytegetType()Array<byte>getData()ValueTypegetValueType()Returns type of this value. ImmutableExtensionValueimmutableValue()Returns immutable copy of this value. ImmutableExtensionValueasExtensionValue()Returns the value as {@code ExtensionValue}.voidwriteTo(MessagePacker packer)Serializes the value using the specified {@code MessagePacker}booleanequals(Object o)inthashCode()StringtoJson()Returns json representation of this Value. StringtoString()-
Methods inherited from class com.batch.android.msgpack.value.impl.AbstractImmutableValue
asArrayValue, asBinaryValue, asBooleanValue, asFloatValue, asIntegerValue, asMapValue, asNilValue, asNumberValue, asRawValue, asStringValue, isArrayValue, isBinaryValue, isBooleanValue, isExtensionValue, isFloatValue, isIntegerValue, isMapValue, isNilValue, isNumberValue, isRawValue, isStringValue -
Methods inherited from class com.batch.android.msgpack.value.Value
asArrayValue, asBinaryValue, asBooleanValue, asExtensionValue, asFloatValue, asIntegerValue, asMapValue, asNilValue, asNumberValue, asRawValue, asStringValue, equals, immutableValue, writeTo -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Constructor Detail
-
ImmutableExtensionValueImpl
ImmutableExtensionValueImpl(byte type, Array<byte> data)
-
-
Method Detail
-
getType
byte getType()
-
getValueType
ValueType getValueType()
Returns type of this value.
Note that you can't use
instanceofto check type of a value because type of a mutable value is variable.
-
immutableValue
ImmutableExtensionValue immutableValue()
Returns immutable copy of this value.
This method simply returns
thiswithout copying the value if this value is already immutable.
-
asExtensionValue
ImmutableExtensionValue asExtensionValue()
Returns the value as
{@code ExtensionValue}. Otherwise throws{@code MessageTypeCastException}.Note that you can't use
instanceofor cast((ExtensionValue) thisValue)to check type of a valuebecause type of a mutable value is variable.
-
writeTo
void writeTo(MessagePacker packer)
Serializes the value using the specified
{@code MessagePacker}
-
hashCode
int hashCode()
-
toJson
String toJson()
Returns json representation of this Value.
Following behavior is not configurable at this release and they might be changed at future releases:
- if a key of MapValue is not string, the key is converted to a string using toString method.
- NaN and Infinity of DoubleValue are converted to null.
- ExtensionValue is converted to a 2-element array where first element is a number and second element is the data encoded in hex.
- BinaryValue is converted to a string using UTF-8 encoding. Invalid byte sequence is replaced with
U+FFFD replacement character. - Invalid UTF-8 byte sequences in StringValue is replaced with
U+FFFD replacement character
-
-
-
-