public class ImmutableStringValueImpl extends AbstractImmutableRawValue implements ImmutableStringValue
ImmutableStringValueImpl Implements ImmutableStringValue using a byte[] field.
This implementation caches result of toString() and asString() using a private String field.StringValuedata| Constructor and Description |
|---|
ImmutableStringValueImpl(byte[] data) |
ImmutableStringValueImpl(java.lang.String string) |
| Modifier and Type | Method and Description |
|---|---|
ImmutableStringValue |
asStringValue()
Returns the value as
StringValue. |
boolean |
equals(java.lang.Object o)
Compares this value to the specified object.
|
ValueType |
getValueType()
Returns type of this value.
|
int |
hashCode() |
ImmutableStringValue |
immutableValue()
Returns immutable copy of this value.
|
void |
writeTo(MessagePacker pk)
Serializes the value using the specified
MessagePacker |
appendJsonString, asByteArray, asByteBuffer, asRawValue, asString, toJson, toStringasArrayValue, asBinaryValue, asBooleanValue, asExtensionValue, asFloatValue, asIntegerValue, asMapValue, asNilValue, asNumberValue, asTimestampValue, isArrayValue, isBinaryValue, isBooleanValue, isExtensionValue, isFloatValue, isIntegerValue, isMapValue, isNilValue, isNumberValue, isRawValue, isStringValue, isTimestampValueclone, finalize, getClass, notify, notifyAll, wait, wait, waitasByteArray, asByteBuffer, asString, toStringasArrayValue, asBinaryValue, asBooleanValue, asFloatValue, asIntegerValue, asMapValue, asNilValue, asRawValue, asTimestampValueasExtensionValue, asNumberValue, isArrayValue, isBinaryValue, isBooleanValue, isExtensionValue, isFloatValue, isIntegerValue, isMapValue, isNilValue, isNumberValue, isRawValue, isStringValue, isTimestampValue, toJsonpublic ImmutableStringValueImpl(byte[] data)
public ImmutableStringValueImpl(java.lang.String string)
public ValueType getValueType()
Valueinstanceof to check type of a value because type of a mutable value is variable.getValueType in interface Valuepublic ImmutableStringValue immutableValue()
Valuethis without copying the value if this value is already immutable.immutableValue in interface Valuepublic ImmutableStringValue asStringValue()
ValueStringValue. Otherwise throws MessageTypeCastException.
Note that you can't use instanceof or cast ((StringValue) thisValue) to check type of a value because type of a mutable value is variable.asStringValue in interface ImmutableValueasStringValue in interface ValueasStringValue in class AbstractImmutableValuepublic void writeTo(MessagePacker pk) throws java.io.IOException
ValueMessagePackerwriteTo in interface Valuejava.io.IOExceptionMessagePackerpublic boolean equals(java.lang.Object o)
Valuetrue if type and value are equivalent.
If this value is MapValue or ArrayValue, this method check equivalence of elements recursively.public int hashCode()
hashCode in class java.lang.Object