Package io.debezium.document
Class BasicArray
- java.lang.Object
-
- io.debezium.document.BasicArray
-
- All Implemented Interfaces:
Array,Comparable<Array>,Iterable<Array.Entry>
@NotThreadSafe final class BasicArray extends Object implements Array
Package-level implementation ofArray.- Author:
- Randall Hauch
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface io.debezium.document.Array
Array.Entry
-
-
Field Summary
Fields Modifier and Type Field Description private static BiFunction<Integer,Value,Array.Entry>CONVERT_PAIR_TO_ENTRYprivate List<Value>values
-
Constructor Summary
Constructors Constructor Description BasicArray()BasicArray(Value[] values)BasicArray(List<Value> values)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Arrayadd(Value value)Adds the value to the end of this array.Arrayclone()Obtain a complete copy of this array.intcompareTo(Array that)booleanequals(Object obj)Arrayexpand(int desiredSize, Value value)If the current size of the array is smaller than the given size, expand it and use the supplied value for all new entries.Valueget(int index)Gets the value in this array at the given index.booleanhas(int index)Determine if this contains an entry at the given index.inthashCode()Arrayincrement(int index, Value increment)Increment the numeric value at the given location by the designated amount.protected intindexFrom(CharSequence name)booleanisEmpty()Return whether this document contains no fields and is therefore empty.protected booleanisValidIndex(int index)Iterator<Array.Entry>iterator()Valueremove(int index)Remove the specified entry from this arrayArrayremoveAll()Remove all entries from this array.ArraysetValue(int index, Value value)Set the value for the field with the given name to be a value.intsize()Return the number of name-value fields in this object.StringtoString()Iterable<Value>values()-
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface io.debezium.document.Array
add, add, add, add, add, add, add, add, add, add, add, add, add, add, add, addAll, addAll, addAll, addAll, addNull, expand, expand, expand, expand, expand, expand, expand, get, increment, increment, increment, increment, isNull, isNullOrMissing, putAll, setArray, setArray, setArray, setBinary, setBoolean, setDocument, setDocument, setNull, setNumber, setNumber, setNumber, setNumber, setNumber, setNumber, setString, streamEntries, streamValues, transform
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
-
-
-
Field Detail
-
CONVERT_PAIR_TO_ENTRY
private static final BiFunction<Integer,Value,Array.Entry> CONVERT_PAIR_TO_ENTRY
-
-
Method Detail
-
indexFrom
protected final int indexFrom(CharSequence name)
-
isValidIndex
protected final boolean isValidIndex(int index)
-
size
public int size()
Description copied from interface:ArrayReturn the number of name-value fields in this object.
-
isEmpty
public boolean isEmpty()
Description copied from interface:ArrayReturn whether this document contains no fields and is therefore empty.
-
compareTo
public int compareTo(Array that)
- Specified by:
compareToin interfaceComparable<Array>
-
iterator
public Iterator<Array.Entry> iterator()
- Specified by:
iteratorin interfaceIterable<Array.Entry>
-
remove
public Value remove(int index)
Description copied from interface:ArrayRemove the specified entry from this array
-
removeAll
public Array removeAll()
Description copied from interface:ArrayRemove all entries from this array.
-
has
public boolean has(int index)
Description copied from interface:ArrayDetermine if this contains an entry at the given index.
-
get
public Value get(int index)
Description copied from interface:ArrayGets the value in this array at the given index.
-
setValue
public Array setValue(int index, Value value)
Description copied from interface:ArraySet the value for the field with the given name to be a value.
-
expand
public Array expand(int desiredSize, Value value)
Description copied from interface:ArrayIf the current size of the array is smaller than the given size, expand it and use the supplied value for all new entries. This method does nothing if the current size is larger than the supplieddesiredSize.
-
increment
public Array increment(int index, Value increment)
Description copied from interface:ArrayIncrement the numeric value at the given location by the designated amount.
-
add
public Array add(Value value)
Description copied from interface:ArrayAdds the value to the end of this array.
-
clone
public Array clone()
Description copied from interface:ArrayObtain a complete copy of this array.
-
-