Package io.confluent.ksql.api.client
Class KsqlArray
java.lang.Object
io.confluent.ksql.api.client.KsqlArray
A representation of an array of values.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionadd
(byte[] value) Appends the specified value to the end of the array.Appends the specified value to the end of the array.add
(KsqlObject value) Appends the specified value to the end of the array.Appends the specified value to the end of the array.Appends the specified value to the end of the array.Appends the specified value to the end of the array.Appends the specified value to the end of the array.Appends the specified value to the end of the array.Appends the specified value to the end of the array.add
(BigDecimal value) Appends the specified value to the end of the array.Appends the values in the specifiedKsqlArray
to the end of this instance.addNull()
Appends a null value to the end of the array.copy()
Returns a copy of this.boolean
getBoolean
(int pos) Returns the value at a specified index as a boolean.byte[]
getBytes
(int pos) Returns the value at a specified index as a byte array.getDecimal
(int pos) Returns the value at a specified index as aBigDecimal
.getDouble
(int pos) Returns the value at a specified index as a double.getInteger
(int pos) Returns the value at a specified index as an integer.getKsqlArray
(int pos) Returns the value at a specified index as aKsqlArray
.getKsqlObject
(int pos) Returns the value at a specified index as aKsqlObject
.List<?>
getList()
Returns values of the array as a list.getLong
(int pos) Returns the value at a specified index as a long.getString
(int pos) Returns the value at a specified index as a string.getValue
(int pos) Returns the value at a specified index as anObject
.int
hashCode()
boolean
isEmpty()
Returns whether the array is empty.iterator()
Returns an iterator over values of the array.remove
(int pos) Removes the value at a specified index from the array.boolean
Removes the first occurrence of the specified value from the array, if present.int
size()
Returns the size (number of values) of the array.stream()
Returns values of the array as a stream.Returns a JSON string representing the values in the array.toString()
Returns a JSON string representing the values in the array.
-
Constructor Details
-
KsqlArray
public KsqlArray()Creates an empty instance. -
KsqlArray
Creates an instance with the specified values.- Parameters:
list
- the values
-
-
Method Details
-
size
public int size()Returns the size (number of values) of the array.- Returns:
- the size
-
isEmpty
public boolean isEmpty()Returns whether the array is empty.- Returns:
- whether the array is empty
-
getList
Returns values of the array as a list.- Returns:
- list of values
-
iterator
Returns an iterator over values of the array.- Returns:
- the iterator
-
stream
Returns values of the array as a stream.- Returns:
- the stream
-
getValue
Returns the value at a specified index as anObject
.- Parameters:
pos
- the index- Returns:
- the value
-
getString
Returns the value at a specified index as a string.- Parameters:
pos
- the index- Returns:
- the value
- Throws:
ClassCastException
- if the value is not a stringIndexOutOfBoundsException
- if the index is invalid
-
getInteger
Returns the value at a specified index as an integer.- Parameters:
pos
- the index- Returns:
- the value
- Throws:
ClassCastException
- if the value is not aNumber
IndexOutOfBoundsException
- if the index is invalid
-
getLong
Returns the value at a specified index as a long.- Parameters:
pos
- the index- Returns:
- the value
- Throws:
ClassCastException
- if the value is not aNumber
IndexOutOfBoundsException
- if the index is invalid
-
getDouble
Returns the value at a specified index as a double.- Parameters:
pos
- the index- Returns:
- the value
- Throws:
ClassCastException
- if the value is not aNumber
IndexOutOfBoundsException
- if the index is invalid
-
getBoolean
Returns the value at a specified index as a boolean.- Parameters:
pos
- the index- Returns:
- the value
- Throws:
ClassCastException
- if the value is not a booleanIndexOutOfBoundsException
- if the index is invalid
-
getDecimal
Returns the value at a specified index as aBigDecimal
.- Parameters:
pos
- the index- Returns:
- the value
- Throws:
ClassCastException
- if the value is not aNumber
IndexOutOfBoundsException
- if the index is invalid
-
getBytes
public byte[] getBytes(int pos) Returns the value at a specified index as a byte array.- Parameters:
pos
- the index- Returns:
- the value
- Throws:
IndexOutOfBoundsException
- if the index is invalidIllegalArgumentException
- if the array value is not a Base64 encoded string
-
getKsqlArray
Returns the value at a specified index as aKsqlArray
.- Parameters:
pos
- the index- Returns:
- the value
- Throws:
ClassCastException
- if the value cannot be converted to a listIndexOutOfBoundsException
- if the index is invalid
-
getKsqlObject
Returns the value at a specified index as aKsqlObject
.- Parameters:
pos
- the index- Returns:
- the value
- Throws:
ClassCastException
- if the value cannot be converted to a mapIndexOutOfBoundsException
- if the index is invalid
-
remove
Removes the value at a specified index from the array.- Parameters:
pos
- the index- Returns:
- the removed value
- Throws:
IndexOutOfBoundsException
- if the index is invalid
-
remove
Removes the first occurrence of the specified value from the array, if present.- Parameters:
value
- the value to remove- Returns:
- whether the value was removed
-
add
Appends the specified value to the end of the array.- Parameters:
value
- the value to append- Returns:
- a reference to this
-
add
Appends the specified value to the end of the array.- Parameters:
value
- the value to append- Returns:
- a reference to this
-
add
Appends the specified value to the end of the array.- Parameters:
value
- the value to append- Returns:
- a reference to this
-
add
Appends the specified value to the end of the array.- Parameters:
value
- the value to append- Returns:
- a reference to this
-
add
Appends the specified value to the end of the array.- Parameters:
value
- the value to append- Returns:
- a reference to this
-
add
Appends the specified value to the end of the array.- Parameters:
value
- the value to append- Returns:
- a reference to this
-
add
Appends the specified value to the end of the array.- Parameters:
value
- the value to append- Returns:
- a reference to this
-
add
Appends the specified value to the end of the array.- Parameters:
value
- the value to append- Returns:
- a reference to this
-
add
Appends the specified value to the end of the array.- Parameters:
value
- the value to append- Returns:
- a reference to this
-
add
Appends the specified value to the end of the array.- Parameters:
value
- the value to append- Returns:
- a reference to this
-
addNull
Appends a null value to the end of the array.- Returns:
- a reference to this
-
addAll
Appends the values in the specifiedKsqlArray
to the end of this instance.- Parameters:
array
- the values to append- Returns:
- a reference to this
-
copy
Returns a copy of this.- Returns:
- the copy
-
toJsonString
Returns a JSON string representing the values in the array.- Returns:
- the JSON string
-
toString
Returns a JSON string representing the values in the array. Same astoJsonString()
. -
equals
-
hashCode
public int hashCode()
-