public class ImmutableArrayValueImpl extends AbstractImmutableValue implements ImmutableArrayValue
ImmutableArrayValueImpl Implements ImmutableArrayValue using a Value[] field.IntegerValue| Modifier and Type | Class and Description |
|---|---|
private static class |
ImmutableArrayValueImpl.ImmutableArrayValueList |
private static class |
ImmutableArrayValueImpl.Ite |
| Modifier and Type | Field and Description |
|---|---|
private Value[] |
array |
private static ImmutableArrayValueImpl |
EMPTY |
| Constructor and Description |
|---|
ImmutableArrayValueImpl(Value[] array) |
| Modifier and Type | Method and Description |
|---|---|
private static void |
appendString(java.lang.StringBuilder sb,
Value value) |
ImmutableArrayValue |
asArrayValue()
Returns the value as
ArrayValue. |
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.
|
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 |
asBinaryValue, asBooleanValue, asExtensionValue, asFloatValue, asIntegerValue, asMapValue, asNilValue, asNumberValue, asRawValue, asStringValue, asTimestampValue, isArrayValue, isBinaryValue, isBooleanValue, isExtensionValue, isFloatValue, isIntegerValue, isMapValue, isNilValue, isNumberValue, isRawValue, isStringValue, isTimestampValueclone, finalize, getClass, notify, notifyAll, wait, wait, waitasBinaryValue, asBooleanValue, asFloatValue, asIntegerValue, asMapValue, asNilValue, asRawValue, asStringValue, asTimestampValueasExtensionValue, asNumberValue, isArrayValue, isBinaryValue, isBooleanValue, isExtensionValue, isFloatValue, isIntegerValue, isMapValue, isNilValue, isNumberValue, isRawValue, isStringValue, isTimestampValueprivate static final ImmutableArrayValueImpl EMPTY
private final Value[] array
public 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 ValueasArrayValue in class AbstractImmutableValuepublic 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.Objectprivate static void appendString(java.lang.StringBuilder sb,
Value value)