public interface Value
ValueType
then call an appropriate asXXXValue method.Modifier and Type | Method and Description |
---|---|
ArrayValue |
asArrayValue()
Returns the value as
ArrayValue . |
BinaryValue |
asBinaryValue()
Returns the value as
BinaryValue . |
BooleanValue |
asBooleanValue()
Returns the value as
BooleanValue . |
ExtensionValue |
asExtensionValue()
Returns the value as
ExtensionValue . |
FloatValue |
asFloatValue()
Returns the value as
FloatValue . |
IntegerValue |
asIntegerValue()
Returns the value as
IntegerValue . |
MapValue |
asMapValue()
Returns the value as
MapValue . |
NilValue |
asNilValue()
Returns the value as
NilValue . |
NumberValue |
asNumberValue()
Returns the value as
NumberValue . |
RawValue |
asRawValue()
Returns the value as
RawValue . |
StringValue |
asStringValue()
Returns the value as
StringValue . |
boolean |
equals(java.lang.Object obj)
Compares this value to the specified object.
|
ValueType |
getValueType()
Returns type of this value.
|
ImmutableValue |
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.
|
java.lang.String |
toJson()
Returns json representation of this Value.
|
void |
writeTo(MessagePacker pk)
Serializes the value using the specified
MessagePacker |
ValueType getValueType()
instanceof
to check type of a value because type of a mutable value is variable.ImmutableValue immutableValue()
this
without copying the value if this value is already immutable.boolean isNilValue()
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.boolean isBooleanValue()
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.boolean isNumberValue()
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.boolean isIntegerValue()
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.boolean isFloatValue()
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.boolean isRawValue()
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.boolean isBinaryValue()
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.boolean isStringValue()
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.boolean isArrayValue()
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.boolean isMapValue()
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.boolean isExtensionValue()
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.NilValue asNilValue()
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.MessageTypeCastException
- If type of this value is not Nil.BooleanValue asBooleanValue()
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.MessageTypeCastException
- If type of this value is not Boolean.NumberValue asNumberValue()
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.MessageTypeCastException
- If type of this value is not Integer or Float.IntegerValue asIntegerValue()
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.MessageTypeCastException
- If type of this value is not Integer.FloatValue asFloatValue()
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.MessageTypeCastException
- If type of this value is not Float.RawValue asRawValue()
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.MessageTypeCastException
- If type of this value is not Binary or String.BinaryValue asBinaryValue()
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.MessageTypeCastException
- If type of this value is not Binary.StringValue asStringValue()
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.MessageTypeCastException
- If type of this value is not String.ArrayValue asArrayValue()
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.MessageTypeCastException
- If type of this value is not Array.MapValue asMapValue()
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.MessageTypeCastException
- If type of this value is not Map.ExtensionValue asExtensionValue()
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.MessageTypeCastException
- If type of this value is not an Extension.void writeTo(MessagePacker pk) throws java.io.IOException
MessagePacker
java.io.IOException
MessagePacker
boolean equals(java.lang.Object obj)
true
if type and value are equivalent.
If this value is MapValue
or ArrayValue
, this method check equivalence of elements recursively.equals
in class java.lang.Object
java.lang.String toJson()
U+FFFD replacement character
.
* Invalid UTF-8 byte sequences in StringValue is replaced with U+FFFD replacement character