public abstract class AbstractImmutableRawValue extends java.lang.Object implements ImmutableRawValue
| Modifier and Type | Field and Description |
|---|---|
protected byte[] |
data |
| Constructor and Description |
|---|
AbstractImmutableRawValue(byte[] data) |
AbstractImmutableRawValue(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. |
byte[] |
asByteArray()
Returns the value as
byte[]. |
java.nio.ByteBuffer |
asByteBuffer()
Returns the value as
ByteBuffer. |
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. |
ImmutableRawValue |
asRawValue()
Returns the value as
RawValue. |
java.lang.String |
asString()
Returns the value as
String. |
ImmutableStringValue |
asStringValue()
Returns the value as
StringValue. |
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.
|
java.lang.String |
toJson()
Returns json representation of this Value.
|
java.lang.String |
toString()
Returns the value as
String. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitasArrayValue, asBinaryValue, asBooleanValue, asFloatValue, asIntegerValue, asMapValue, asNilValue, asStringValueasExtensionValue, asNumberValue, equals, getValueType, immutableValue, isArrayValue, isBinaryValue, isBooleanValue, isExtensionValue, isFloatValue, isIntegerValue, isMapValue, isNilValue, isNumberValue, isRawValue, isStringValue, writeTopublic AbstractImmutableRawValue(byte[] data)
public AbstractImmutableRawValue(java.lang.String string)
public ImmutableRawValue asRawValue()
ValueRawValue. Otherwise throws MessageTypeCastException.
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.asRawValue in interface ImmutableValueasRawValue in interface Valuepublic byte[] asByteArray()
RawValuebyte[].
This method copies the byte array.asByteArray in interface RawValuepublic java.nio.ByteBuffer asByteBuffer()
RawValueByteBuffer.
Returned ByteBuffer is read-only. See also ByteBuffer.asReadOnlyBuffer().
This method doesn't copy the byte array as much as possible.asByteBuffer in interface RawValuepublic java.lang.String asString()
RawValueString.
This method throws an exception if the value includes invalid UTF-8 byte sequence.public java.lang.String toJson()
ValueFollowing behavior is not configurable at this release and they might be changed at future releases:
U+FFFD replacement character.U+FFFD replacement characterpublic java.lang.String toString()
RawValueString.
This method replaces an invalid UTF-8 byte sequence with U+FFFD replacement character.public 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 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 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