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_ENTRY
private 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 Array
add(Value value)
Adds the value to the end of this array.Array
clone()
Obtain a complete copy of this array.int
compareTo(Array that)
boolean
equals(Object obj)
Array
expand(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.Value
get(int index)
Gets the value in this array at the given index.boolean
has(int index)
Determine if this contains an entry at the given index.int
hashCode()
Array
increment(int index, Value increment)
Increment the numeric value at the given location by the designated amount.protected int
indexFrom(CharSequence name)
boolean
isEmpty()
Return whether this document contains no fields and is therefore empty.protected boolean
isValidIndex(int index)
Iterator<Array.Entry>
iterator()
Value
remove(int index)
Remove the specified entry from this arrayArray
removeAll()
Remove all entries from this array.Array
setValue(int index, Value value)
Set the value for the field with the given name to be a value.int
size()
Return the number of name-value fields in this object.String
toString()
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:Array
Return the number of name-value fields in this object.
-
isEmpty
public boolean isEmpty()
Description copied from interface:Array
Return whether this document contains no fields and is therefore empty.
-
compareTo
public int compareTo(Array that)
- Specified by:
compareTo
in interfaceComparable<Array>
-
iterator
public Iterator<Array.Entry> iterator()
- Specified by:
iterator
in interfaceIterable<Array.Entry>
-
remove
public Value remove(int index)
Description copied from interface:Array
Remove the specified entry from this array
-
removeAll
public Array removeAll()
Description copied from interface:Array
Remove all entries from this array.
-
has
public boolean has(int index)
Description copied from interface:Array
Determine if this contains an entry at the given index.
-
get
public Value get(int index)
Description copied from interface:Array
Gets the value in this array at the given index.
-
setValue
public Array setValue(int index, Value value)
Description copied from interface:Array
Set 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:Array
If 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:Array
Increment the numeric value at the given location by the designated amount.
-
add
public Array add(Value value)
Description copied from interface:Array
Adds the value to the end of this array.
-
clone
public Array clone()
Description copied from interface:Array
Obtain a complete copy of this array.
-
-