-
- All Implemented Interfaces:
-
com.batch.android.msgpack.value.ImmutableRawValue,com.batch.android.msgpack.value.ImmutableStringValue,com.batch.android.msgpack.value.ImmutableValue,com.batch.android.msgpack.value.RawValue,com.batch.android.msgpack.value.StringValue,com.batch.android.msgpack.value.Value
public class ImmutableStringValueImpl extends AbstractImmutableRawValue implements ImmutableStringValue
{@code ImmutableStringValueImpl}Implements{@code ImmutableStringValue}using a{@code byte[]}field. This implementation caches result of{@code toString()}and{@code asString()}using a private{@code String}field.
-
-
Constructor Summary
Constructors Constructor Description ImmutableStringValueImpl(Array<byte> data)ImmutableStringValueImpl(String string)
-
Method Summary
Modifier and Type Method Description ValueTypegetValueType()Returns type of this value. ImmutableStringValueimmutableValue()Returns immutable copy of this value. ImmutableStringValueasStringValue()Returns the value as {@code StringValue}.voidwriteTo(MessagePacker pk)Serializes the value using the specified {@code MessagePacker}booleanequals(Object o)inthashCode()-
Methods inherited from class com.batch.android.msgpack.value.impl.AbstractImmutableRawValue
asByteArray, asByteBuffer, asRawValue, asString, toJson, toString -
Methods inherited from class com.batch.android.msgpack.value.impl.AbstractImmutableValue
asArrayValue, asBinaryValue, asBooleanValue, asExtensionValue, asFloatValue, asIntegerValue, asMapValue, asNilValue, asNumberValue, 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 -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Method Detail
-
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
ImmutableStringValue immutableValue()
Returns immutable copy of this value.
This method simply returns
thiswithout copying the value if this value is already immutable.
-
asStringValue
ImmutableStringValue asStringValue()
Returns the value as
{@code StringValue}. Otherwise throws{@code MessageTypeCastException}.Note that you can't use
instanceofor cast((StringValue) thisValue)to check type of a value because type of a mutable value is variable.
-
writeTo
void writeTo(MessagePacker pk)
Serializes the value using the specified
{@code MessagePacker}
-
hashCode
int hashCode()
-
-
-
-