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, wait
asArrayValue, asBinaryValue, asBooleanValue, asFloatValue, asIntegerValue, asMapValue, asNilValue, asStringValue
asExtensionValue, asNumberValue, equals, getValueType, immutableValue, isArrayValue, isBinaryValue, isBooleanValue, isExtensionValue, isFloatValue, isIntegerValue, isMapValue, isNilValue, isNumberValue, isRawValue, isStringValue, writeTo
public AbstractImmutableRawValue(byte[] data)
public AbstractImmutableRawValue(java.lang.String string)
public ImmutableRawValue asRawValue()
Value
RawValue
. 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 ImmutableValue
asRawValue
in interface Value
public byte[] asByteArray()
RawValue
byte[]
.
This method copies the byte array.asByteArray
in interface RawValue
public java.nio.ByteBuffer asByteBuffer()
RawValue
ByteBuffer
.
Returned ByteBuffer is read-only. See also ByteBuffer.asReadOnlyBuffer()
.
This method doesn't copy the byte array as much as possible.asByteBuffer
in interface RawValue
public java.lang.String asString()
RawValue
String
.
This method throws an exception if the value includes invalid UTF-8 byte sequence.public java.lang.String toJson()
Value
Following behavior is not configurable at this release and they might be changed at future releases:
U+FFFD replacement character
.U+FFFD replacement character
public java.lang.String toString()
RawValue
String
.
This method replaces an invalid UTF-8 byte sequence with U+FFFD replacement character
.public boolean isNilValue()
Value
asNilValue
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 Value
public boolean isBooleanValue()
Value
asBooleanValue
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 Value
public boolean isNumberValue()
Value
asNumberValue
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 Value
public boolean isIntegerValue()
Value
asIntegerValue
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 Value
public boolean isFloatValue()
Value
asFloatValue
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 Value
public boolean isRawValue()
Value
asRawValue
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 Value
public boolean isBinaryValue()
Value
asBinaryValue
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 Value
public boolean isStringValue()
Value
asStringValue
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 Value
public boolean isArrayValue()
Value
asArrayValue
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 Value
public boolean isMapValue()
Value
asMapValue
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 Value
public boolean isExtensionValue()
Value
asExtensionValue
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 Value
public ImmutableNilValue asNilValue()
Value
NilValue
. 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 ImmutableValue
asNilValue
in interface Value
public ImmutableBooleanValue asBooleanValue()
Value
BooleanValue
. 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 ImmutableValue
asBooleanValue
in interface Value
public ImmutableNumberValue asNumberValue()
Value
NumberValue
. 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 Value
public ImmutableIntegerValue asIntegerValue()
Value
IntegerValue
. 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 ImmutableValue
asIntegerValue
in interface Value
public ImmutableFloatValue asFloatValue()
Value
FloatValue
. 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 ImmutableValue
asFloatValue
in interface Value
public ImmutableBinaryValue asBinaryValue()
Value
BinaryValue
. 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 ImmutableValue
asBinaryValue
in interface Value
public ImmutableStringValue asStringValue()
Value
StringValue
. 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 ImmutableValue
asStringValue
in interface Value
public ImmutableArrayValue asArrayValue()
Value
ArrayValue
. 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 ImmutableValue
asArrayValue
in interface Value
public ImmutableMapValue asMapValue()
Value
MapValue
. 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 ImmutableValue
asMapValue
in interface Value
public ImmutableExtensionValue asExtensionValue()
Value
ExtensionValue
. 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