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 |
|---|---|
ImmutableArrayValue |
asArrayValue()
Returns the value as
ArrayValue. |
ImmutableBinaryValue |
asBinaryValue()
Returns the value as
BinaryValue. |
ImmutableBooleanValue |
asBooleanValue()
Returns the value as
BooleanValue. |
ImmutableExtensionValue |
asExtensionValue()
Returns the value as
ExtensionValue. |
ImmutableFloatValue |
asFloatValue()
Returns the value as
FloatValue. |
ImmutableIntegerValue |
asIntegerValue()
Returns the value as
IntegerValue. |
ImmutableMapValue |
asMapValue()
Returns the value as
MapValue. |
ImmutableNilValue |
asNilValue()
Returns the value as
NilValue. |
ImmutableNumberValue |
asNumberValue()
Returns the value as
NumberValue. |
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.
|
boolean |
isArrayValue()
Returns true if type of this value is Array.
|
boolean |
isBinaryValue()
Returns true if type of this value is Binary.
|
boolean |
isBooleanValue()
Returns true if type of this value is Boolean.
|
boolean |
isExtensionValue()
Returns true if type of this an Extension.
|
boolean |
isFloatValue()
Returns true if type of this value is Float.
|
boolean |
isIntegerValue()
Returns true if type of this value is Integer.
|
boolean |
isMapValue()
Returns true if type of this value is Map.
|
boolean |
isNilValue()
Returns true if type of this value is Nil.
|
boolean |
isNumberValue()
Returns true if type of this value is Integer or Float.
|
boolean |
isRawValue()
Returns true if type of this value is String or Binary.
|
boolean |
isStringValue()
Returns true if type of this value is String.
|
void |
writeTo(MessagePacker pk)
Serializes the value using the specified
MessagePacker |
asByteArray, asByteBuffer, asRawValue, asString, toJson, toStringclone, finalize, getClass, notify, notifyAll, wait, wait, waitasByteArray, asByteBuffer, asString, toStringasArrayValue, asBinaryValue, asBooleanValue, asFloatValue, asIntegerValue, asMapValue, asNilValue, asRawValueasExtensionValue, asNumberValue, isArrayValue, isBinaryValue, isBooleanValue, isExtensionValue, isFloatValue, isIntegerValue, isMapValue, isNilValue, isNumberValue, isRawValue, isStringValue, 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 Valuepublic 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.Objectpublic boolean isNilValue()
ValueasNilValue never throws exceptions.
Note that you can't use instanceof or cast ((NilValue) thisValue) to check type of a value because type of a mutable value is variable.isNilValue in interface Valuepublic boolean isBooleanValue()
ValueasBooleanValue never throws exceptions.
Note that you can't use instanceof or cast ((BooleanValue) thisValue) to check type of a value because type of a mutable value is variable.isBooleanValue in interface Valuepublic boolean isNumberValue()
ValueasNumberValue never throws exceptions.
Note that you can't use instanceof or cast ((NumberValue) thisValue) to check type of a value because type of a mutable value is variable.isNumberValue in interface Valuepublic boolean isIntegerValue()
ValueasIntegerValue never throws exceptions.
Note that you can't use instanceof or cast ((IntegerValue) thisValue) to check type of a value because type of a mutable value is variable.isIntegerValue in interface Valuepublic boolean isFloatValue()
ValueasFloatValue never throws exceptions.
Note that you can't use instanceof or cast ((FloatValue) thisValue) to check type of a value because type of a mutable value is variable.isFloatValue in interface Valuepublic boolean isRawValue()
ValueasRawValue never throws exceptions.
Note that you can't use instanceof or cast ((RawValue) thisValue) to check type of a value because type of a mutable value is variable.isRawValue in interface Valuepublic boolean isBinaryValue()
ValueasBinaryValue never throws exceptions.
Note that you can't use instanceof or cast ((BinaryValue) thisValue) to check type of a value because type of a mutable value is variable.isBinaryValue in interface Valuepublic boolean isStringValue()
ValueasStringValue never throws exceptions.
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.isStringValue in interface Valuepublic boolean isArrayValue()
ValueasArrayValue never throws exceptions.
Note that you can't use instanceof or cast ((ArrayValue) thisValue) to check type of a value because type of a mutable value is variable.isArrayValue in interface Valuepublic boolean isMapValue()
ValueasMapValue never throws exceptions.
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.isMapValue in interface Valuepublic boolean isExtensionValue()
ValueasExtensionValue never throws exceptions.
Note that you can't use instanceof or cast ((ExtensionValue) thisValue) to check type of a value because
type of a mutable value is variable.isExtensionValue in interface Valuepublic ImmutableNilValue asNilValue()
ValueNilValue. Otherwise throws MessageTypeCastException.
Note that you can't use instanceof or cast ((NilValue) thisValue) to check type of a value because type of a mutable value is variable.asNilValue in interface ImmutableValueasNilValue in interface Valuepublic ImmutableBooleanValue asBooleanValue()
ValueBooleanValue. Otherwise throws MessageTypeCastException.
Note that you can't use instanceof or cast ((BooleanValue) thisValue) to check type of a value because type of a mutable value is variable.asBooleanValue in interface ImmutableValueasBooleanValue in interface Valuepublic ImmutableNumberValue asNumberValue()
ValueNumberValue. Otherwise throws MessageTypeCastException.
Note that you can't use instanceof or cast ((NumberValue) thisValue) to check type of a value because type of a mutable value is variable.asNumberValue in interface Valuepublic ImmutableIntegerValue asIntegerValue()
ValueIntegerValue. Otherwise throws MessageTypeCastException.
Note that you can't use instanceof or cast ((IntegerValue) thisValue) to check type of a value because type of a mutable value is variable.asIntegerValue in interface ImmutableValueasIntegerValue in interface Valuepublic ImmutableFloatValue asFloatValue()
ValueFloatValue. Otherwise throws MessageTypeCastException.
Note that you can't use instanceof or cast ((FloatValue) thisValue) to check type of a value because type of a mutable value is variable.asFloatValue in interface ImmutableValueasFloatValue in interface Valuepublic ImmutableBinaryValue asBinaryValue()
ValueBinaryValue. Otherwise throws MessageTypeCastException.
Note that you can't use instanceof or cast ((BinaryValue) thisValue) to check type of a value because type of a mutable value is variable.asBinaryValue in interface ImmutableValueasBinaryValue in interface Valuepublic ImmutableArrayValue asArrayValue()
ValueArrayValue. Otherwise throws MessageTypeCastException.
Note that you can't use instanceof or cast ((ArrayValue) thisValue) to check type of a value because type of a mutable value is variable.asArrayValue in interface ImmutableValueasArrayValue in interface Valuepublic ImmutableMapValue 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 ImmutableValueasMapValue in interface Valuepublic ImmutableExtensionValue asExtensionValue()
ValueExtensionValue. Otherwise throws MessageTypeCastException.
Note that you can't use instanceof or cast ((ExtensionValue) thisValue) to check type of a value
because type of a mutable value is variable.asExtensionValue in interface Value