| Modifier and Type | Class and Description |
|---|---|
static class |
Variable.Type |
| Constructor and Description |
|---|
Variable() |
| 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 o)
Compares this value to the specified object.
|
ValueType |
getValueType()
Returns type of this value.
|
int |
hashCode() |
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.
|
Variable |
setArrayValue(java.util.List<Value> v) |
Variable |
setArrayValue(Value[] v) |
Variable |
setBinaryValue(byte[] v) |
Variable |
setBooleanValue(boolean v) |
Variable |
setExtensionValue(byte type,
byte[] data) |
Variable |
setFloatValue(double v) |
Variable |
setFloatValue(float v) |
Variable |
setIntegerValue(java.math.BigInteger v) |
Variable |
setIntegerValue(long v) |
Variable |
setMapValue(java.util.Map<Value,Value> v) |
Variable |
setMapValue(Value[] kvs) |
Variable |
setNilValue() |
Variable |
setStringValue(byte[] v) |
Variable |
setStringValue(java.lang.String v) |
java.lang.String |
toJson()
Returns json representation of this Value.
|
java.lang.String |
toString() |
void |
writeTo(MessagePacker pk)
Serializes the value using the specified
MessagePacker |
public Variable setNilValue()
public Variable setBooleanValue(boolean v)
public Variable setIntegerValue(long v)
public Variable setIntegerValue(java.math.BigInteger v)
public Variable setFloatValue(double v)
public Variable setFloatValue(float v)
public Variable setBinaryValue(byte[] v)
public Variable setStringValue(java.lang.String v)
public Variable setStringValue(byte[] v)
public Variable setExtensionValue(byte type, byte[] data)
public ImmutableValue immutableValue()
Valuethis without copying the value if this value is already immutable.immutableValue in interface Valuepublic void writeTo(MessagePacker pk) throws java.io.IOException
ValueMessagePackerwriteTo in interface Valuejava.io.IOExceptionMessagePackerpublic int hashCode()
hashCode in class java.lang.Objectpublic 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 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()
toString in class java.lang.Objectpublic ValueType getValueType()
Valueinstanceof to check type of a value because type of a mutable value is variable.getValueType in interface Valuepublic 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 NilValue 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 Valuepublic BooleanValue 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 Valuepublic NumberValue 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 IntegerValue 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 Valuepublic FloatValue 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 Valuepublic RawValue 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 Valuepublic BinaryValue 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 Valuepublic StringValue 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 Valuepublic ArrayValue 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 Valuepublic MapValue 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 Valuepublic ExtensionValue 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