public class ImmutableArrayValueImpl extends java.lang.Object implements ImmutableArrayValue
ImmutableArrayValueImpl Implements ImmutableArrayValue using a Value[] field.IntegerValue| Constructor and Description |
|---|
ImmutableArrayValueImpl(Value[] array) |
| 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. |
ImmutableRawValue |
asRawValue()
Returns the value as
RawValue. |
ImmutableStringValue |
asStringValue()
Returns the value as
StringValue. |
static ImmutableArrayValue |
empty() |
boolean |
equals(java.lang.Object o)
Compares this value to the specified object.
|
Value |
get(int index)
Returns the element at the specified position in this array.
|
Value |
getOrNilValue(int index)
Returns the element at the specified position in this array.
|
ValueType |
getValueType()
Returns type of this value.
|
int |
hashCode() |
ImmutableArrayValue |
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.util.Iterator<Value> |
iterator()
Returns an iterator over elements.
|
java.util.List<Value> |
list()
Returns the value as
List. |
int |
size()
Returns number of elements in this array.
|
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 |
clone, finalize, getClass, notify, notifyAll, wait, wait, waitasBinaryValue, asBooleanValue, asFloatValue, asIntegerValue, asMapValue, asNilValue, asRawValue, asStringValueasExtensionValue, asNumberValue, isArrayValue, isBinaryValue, isBooleanValue, isExtensionValue, isFloatValue, isIntegerValue, isMapValue, isNilValue, isNumberValue, isRawValue, isStringValuepublic ImmutableArrayValueImpl(Value[] array)
public static ImmutableArrayValue empty()
public ValueType getValueType()
Valueinstanceof to check type of a value because type of a mutable value is variable.getValueType in interface Valuepublic ImmutableArrayValue immutableValue()
Valuethis without copying the value if this value is already immutable.immutableValue 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 int size()
ArrayValuesize in interface ArrayValuepublic Value get(int index)
ArrayValueget in interface ArrayValuepublic Value getOrNilValue(int index)
ArrayValuegetOrNilValue in interface ArrayValuepublic java.util.Iterator<Value> iterator()
ImmutableArrayValueremove() method since the value is immutable.iterator in interface java.lang.Iterable<Value>iterator in interface ArrayValueiterator in interface ImmutableArrayValuepublic java.util.List<Value> list()
ImmutableArrayValueList.
Returned List is immutable. It does not support put(), clear(), or other methods that modify the value.list in interface ArrayValuelist in interface ImmutableArrayValuepublic 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 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 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 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 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 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