public interface Tuple
CAUTION: indexes start at 0, not at 1.
Modifier and Type | Field and Description |
---|---|
static Object |
JSON_NULL
The JSON null literal value.
|
Modifier and Type | Method and Description |
---|---|
default Tuple |
addArrayOfBigDecimal(BigDecimal[] value)
Add an array of
BigDecimal value at the end of the tuple. |
default Tuple |
addArrayOfBoolean(Boolean[] value)
Add an array of
Boolean value at the end of the tuple. |
default Tuple |
addArrayOfBuffer(Buffer[] value)
Add an array of
Buffer value at the end of the tuple. |
default Tuple |
addArrayOfDouble(Double[] value)
Add an array of
Double value at the end of the tuple. |
default Tuple |
addArrayOfFloat(Float[] value)
Add an array of
Float value at the end of the tuple. |
default Tuple |
addArrayOfInteger(Integer[] value)
Add an array of
Integer value at the end of the tuple. |
default Tuple |
addArrayOfJsonArray(JsonArray[] value)
Add an array of
JsonArray value at the end of the tuple. |
default Tuple |
addArrayOfJsonObject(JsonObject[] value)
Add an array of
JsonObject value at the end of the tuple. |
default Tuple |
addArrayOfLocalDate(java.time.LocalDate[] value)
Add an array of
LocalDate value at the end of the tuple. |
default Tuple |
addArrayOfLocalDateTime(java.time.LocalDateTime[] value)
Add an array of
LocalDateTime value at the end of the tuple. |
default Tuple |
addArrayOfLocalTime(java.time.LocalTime[] value)
Add an array of
LocalTime value at the end of the tuple. |
default Tuple |
addArrayOfLong(Long[] value)
Add an array of
Long value at the end of the tuple. |
default Tuple |
addArrayOfOffsetDateTime(java.time.OffsetDateTime[] value)
Add an array of
OffsetDateTime value at the end of the tuple. |
default Tuple |
addArrayOfOffsetTime(java.time.OffsetTime[] value)
Add an array of
OffsetTime value at the end of the tuple. |
default Tuple |
addArrayOfShort(Short[] value)
Add an array of
Short value at the end of the tuple. |
default Tuple |
addArrayOfString(String[] value)
Add an array of
String value at the end of the tuple. |
default Tuple |
addArrayOfTemporal(java.time.temporal.Temporal[] value)
Add an array of
Temporal value at the end of the tuple. |
default Tuple |
addArrayOfUUID(UUID[] value)
Add an array of
UUID value at the end of the tuple. |
default Tuple |
addBigDecimal(BigDecimal value)
Add a
BigDecimal value at the end of the tuple. |
default Tuple |
addBoolean(Boolean value)
Add a boolean value at the end of the tuple.
|
default Tuple |
addBuffer(Buffer value)
Add a buffer value at the end of the tuple.
|
default Tuple |
addDouble(Double value)
Add a double value at the end of the tuple.
|
default Tuple |
addFloat(Float value)
Add a float value at the end of the tuple.
|
default Tuple |
addInteger(Integer value)
Add an integer value at the end of the tuple.
|
default Tuple |
addJsonArray(JsonArray value)
Add a
JsonArray value at the end of the tuple. |
default Tuple |
addJsonObject(JsonObject value)
Add a
JsonObject value at the end of the tuple. |
default Tuple |
addLocalDate(java.time.LocalDate value)
Add a
LocalDate value at the end of the tuple. |
default Tuple |
addLocalDateTime(java.time.LocalDateTime value)
Add a
LocalDateTime value at the end of the tuple. |
default Tuple |
addLocalTime(java.time.LocalTime value)
Add a
LocalTime value at the end of the tuple. |
default Tuple |
addLong(Long value)
Add a long value at the end of the tuple.
|
default Tuple |
addOffsetDateTime(java.time.OffsetDateTime value)
Add a
OffsetDateTime value at the end of the tuple. |
default Tuple |
addOffsetTime(java.time.OffsetTime value)
Add a
OffsetTime value at the end of the tuple. |
default Tuple |
addShort(Short value)
Add a short value at the end of the tuple.
|
default Tuple |
addString(String value)
Add a string value at the end of the tuple.
|
default Tuple |
addTemporal(java.time.temporal.Temporal value)
Add a
Temporal value at the end of the tuple. |
default Tuple |
addUUID(UUID value)
Add a
UUID value at the end of the tuple. |
Tuple |
addValue(Object value)
Add an object value at the end of the tuple.
|
void |
clear() |
default String |
deepToString() |
static <T> Tuple |
from(List<T> list)
Wrap the provided
list with a tuple. |
static Tuple |
from(Object[] array)
Wrap the provided
array with a tuple. |
default <T> T |
get(Class<T> type,
int position)
Get the the at the specified
position and the specified type . |
default BigDecimal[] |
getArrayOfBigDecimals(int pos)
Get an array of
BigDecimal value at pos . |
default Boolean[] |
getArrayOfBooleans(int pos)
Get an array of
Boolean value at pos . |
default Buffer[] |
getArrayOfBuffers(int pos)
Get an array of
Buffer value at pos . |
default Double[] |
getArrayOfDoubles(int pos)
Get an array of
Double value at pos . |
default Float[] |
getArrayOfFloats(int pos)
Get an array of
Float value at pos . |
default Integer[] |
getArrayOfIntegers(int pos)
Get an array of
Integer value at pos . |
default JsonArray[] |
getArrayOfJsonArrays(int pos)
Get an array of
JsonArray value at pos . |
default JsonObject[] |
getArrayOfJsonObjects(int pos)
Get an array of
JsonObject value at pos . |
default Object[] |
getArrayOfJsons(int pos)
Get an array of JSON elements at
pos , the element might be null or one of the following types:
String
Number
JsonObject
JsonArray
Boolean
|
default java.time.LocalDate[] |
getArrayOfLocalDates(int pos)
Get an array of
LocalDate value at pos . |
default java.time.LocalDateTime[] |
getArrayOfLocalDateTimes(int pos)
Get an array of
LocalDateTime value at pos . |
default java.time.LocalTime[] |
getArrayOfLocalTimes(int pos)
Get an array of
LocalTime value at pos . |
default Long[] |
getArrayOfLongs(int pos)
Get an array of
Long value at pos . |
default Numeric[] |
getArrayOfNumerics(int pos)
Get an array of
Numeric value at pos . |
default java.time.OffsetDateTime[] |
getArrayOfOffsetDateTimes(int pos)
Get an array of
OffsetDateTime value at pos . |
default java.time.OffsetTime[] |
getArrayOfOffsetTimes(int pos)
Get an array of
OffsetTime value at pos . |
default Short[] |
getArrayOfShorts(int pos)
Get an array of
Short value at pos . |
default String[] |
getArrayOfStrings(int pos)
Get an array of
String value at pos . |
default java.time.temporal.Temporal[] |
getArrayOfTemporals(int pos)
Get an array of
Temporal value at pos . |
default UUID[] |
getArrayOfUUIDs(int pos)
Get an array of
UUID value at pos . |
default BigDecimal |
getBigDecimal(int pos)
Get
BigDecimal value at pos . |
default Boolean |
getBoolean(int pos)
Get a boolean value at
pos . |
default Buffer |
getBuffer(int pos)
Get a buffer value at
pos . |
default Double |
getDouble(int pos)
Get a double value at
pos . |
default Float |
getFloat(int pos)
Get a float value at
pos . |
default Integer |
getInteger(int pos)
Get an integer value at
pos . |
default Object |
getJson(int pos)
Get a JSON element at
pos , the element might be null or one of the following types:
String
Number
JsonObject
JsonArray
Boolean
|
default JsonArray |
getJsonArray(int pos)
Get a
JsonArray value at pos . |
default JsonObject |
getJsonObject(int pos)
Get a
JsonObject value at pos . |
default java.time.LocalDate |
getLocalDate(int pos)
Get
LocalDate value at pos . |
default java.time.LocalDateTime |
getLocalDateTime(int pos)
Get
LocalDateTime value at pos . |
default java.time.LocalTime |
getLocalTime(int pos)
Get
LocalTime value at pos . |
default Long |
getLong(int pos)
Get a long value at
pos . |
default Numeric |
getNumeric(int pos)
Get
Numeric value at pos . |
default java.time.OffsetDateTime |
getOffsetDateTime(int pos)
Get
OffsetDateTime value at pos . |
default java.time.OffsetTime |
getOffsetTime(int pos)
Get
OffsetTime value at pos . |
default Short |
getShort(int pos)
Get a short value at
pos . |
default String |
getString(int pos)
Get a string value at
pos . |
default java.time.temporal.Temporal |
getTemporal(int pos)
Get a
Temporal value at pos . |
default UUID |
getUUID(int pos)
Get
UUID value at pos . |
Object |
getValue(int pos)
Get an object value at
pos . |
static Tuple |
of(Object elt1)
Create a tuple of one element.
|
static Tuple |
of(Object elt1,
Object... elts)
Create a tuple of an arbitrary number of elements.
|
static Tuple |
of(Object elt1,
Object elt2)
Create a tuple of two elements.
|
static Tuple |
of(Object elt1,
Object elt2,
Object elt3)
Create a tuple of three elements.
|
static Tuple |
of(Object elt1,
Object elt2,
Object elt3,
Object elt4)
Create a tuple of four elements.
|
static Tuple |
of(Object elt1,
Object elt2,
Object elt3,
Object elt4,
Object elt5)
Create a tuple of five elements.
|
static Tuple |
of(Object elt1,
Object elt2,
Object elt3,
Object elt4,
Object elt5,
Object elt6)
Create a tuple of six elements.
|
int |
size() |
static Tuple |
tuple() |
static Tuple |
tuple(List<Object> elements)
Create a tuple with the provided
elements list. |
List<Class<?>> |
types() |
static <T> Tuple |
wrap(List<T> list)
Wrap the provided
list with a tuple. |
static Tuple |
wrap(Object[] array)
Wrap the provided
array with a tuple. |
static final Object JSON_NULL
null
value. This is only
used when the database supports JSON types.static Tuple tuple()
static <T> Tuple from(List<T> list)
list
with a tuple.
static Tuple from(Object[] array)
array
with a tuple.
static <T> Tuple wrap(List<T> list)
list
with a tuple.
tuple(List)
if the list is unmodifiablestatic Tuple wrap(Object[] array)
array
with a tuple.
static Tuple of(Object elt1)
elt1
- the first valuestatic Tuple of(Object elt1, Object elt2)
elt1
- the first valueelt2
- the second valuestatic Tuple of(Object elt1, Object elt2, Object elt3)
elt1
- the first valueelt2
- the second valueelt3
- the third valuestatic Tuple of(Object elt1, Object elt2, Object elt3, Object elt4)
elt1
- the first valueelt2
- the second valueelt3
- the third valueelt4
- the fourth valuestatic Tuple of(Object elt1, Object elt2, Object elt3, Object elt4, Object elt5)
elt1
- the first valueelt2
- the second valueelt3
- the third valueelt4
- the fourth valueelt5
- the fifth valuestatic Tuple of(Object elt1, Object elt2, Object elt3, Object elt4, Object elt5, Object elt6)
elt1
- the first valueelt2
- the second valuegelt3
- the third valueelt4
- the fourth valueelt5
- the fifth valueelt6
- the sixth valuestatic Tuple of(Object elt1, Object... elts)
elt1
- the first elementelts
- the remaining elementsstatic Tuple tuple(List<Object> elements)
elements
list.
The elements
list is not modified.elements
- the list of elementsObject getValue(int pos)
pos
.pos
- the positiondefault Boolean getBoolean(int pos)
pos
.pos
- the positiondefault Short getShort(int pos)
pos
.pos
- the positiondefault Integer getInteger(int pos)
pos
.pos
- the positiondefault Long getLong(int pos)
pos
.pos
- the positiondefault Float getFloat(int pos)
pos
.pos
- the positiondefault Double getDouble(int pos)
pos
.pos
- the positiondefault Numeric getNumeric(int pos)
Numeric
value at pos
.pos
- the positiondefault String getString(int pos)
pos
.pos
- the positiondefault JsonObject getJsonObject(int pos)
JsonObject
value at pos
.pos
- the positiondefault JsonArray getJsonArray(int pos)
JsonArray
value at pos
.pos
- the positiondefault Object getJson(int pos)
pos
, the element might be null
or one of the following types:
pos
- the positiondefault java.time.temporal.Temporal getTemporal(int pos)
Temporal
value at pos
.pos
- the positiondefault java.time.LocalDate getLocalDate(int pos)
LocalDate
value at pos
.
Target element instance of LocalDateTime
will be
coerced to LocalDate
.
pos
- the positiondefault java.time.LocalTime getLocalTime(int pos)
LocalTime
value at pos
.
Target element instance of LocalDateTime
will be
coerced to LocalTime
.
pos
- the positiondefault java.time.LocalDateTime getLocalDateTime(int pos)
LocalDateTime
value at pos
.pos
- the positiondefault java.time.OffsetTime getOffsetTime(int pos)
OffsetTime
value at pos
.
Target element instance of OffsetDateTime
will be
coerced to OffsetTime
.
pos
- the positiondefault java.time.OffsetDateTime getOffsetDateTime(int pos)
OffsetDateTime
value at pos
.pos
- the positiondefault Buffer getBuffer(int pos)
pos
.pos
- the positiondefault UUID getUUID(int pos)
UUID
value at pos
.pos
- the positiondefault BigDecimal getBigDecimal(int pos)
BigDecimal
value at pos
.pos
- the positiondefault Boolean[] getArrayOfBooleans(int pos)
Boolean
value at pos
.
Target element instance of Object[]
will be
coerced to Boolean[]
.
pos
- the positiondefault Short[] getArrayOfShorts(int pos)
Short
value at pos
.
Target element instance of Number[]
or Object[]
will be
coerced to Short[]
.
pos
- the positiondefault Integer[] getArrayOfIntegers(int pos)
Integer
value at pos
.
Target element instance of Number[]
or Object[]
will be
coerced to Integer[]
.
pos
- the positiondefault Long[] getArrayOfLongs(int pos)
Long
value at pos
.
Target element instance of Number[]
or Object[]
will be
coerced to Long[]
.
pos
- the positiondefault Float[] getArrayOfFloats(int pos)
Float
value at pos
.
Target element instance of Number[]
or Object[]
will be
coerced to Float[]
.
pos
- the positiondefault Double[] getArrayOfDoubles(int pos)
Double
value at pos
.
Target element instance of Number[]
or Object[]
will be
coerced to Double[]
.
pos
- the positiondefault Numeric[] getArrayOfNumerics(int pos)
Numeric
value at pos
.pos
- the columndefault String[] getArrayOfStrings(int pos)
String
value at pos
.
Target element instance of Object[]
will be
coerced to String[]
.
pos
- the positiondefault JsonObject[] getArrayOfJsonObjects(int pos)
JsonObject
value at pos
.pos
- the positiondefault JsonArray[] getArrayOfJsonArrays(int pos)
JsonArray
value at pos
.pos
- the positiondefault Object[] getArrayOfJsons(int pos)
pos
, the element might be null
or one of the following types:
pos
- the positiondefault java.time.temporal.Temporal[] getArrayOfTemporals(int pos)
Temporal
value at pos
.pos
- the positiondefault java.time.LocalDate[] getArrayOfLocalDates(int pos)
LocalDate
value at pos
.
Target element instance of LocalDateTime[]
will be
coerced to LocalDate[]
.
pos
- the positiondefault java.time.LocalTime[] getArrayOfLocalTimes(int pos)
LocalTime
value at pos
.
Target element instance of LocalDateTime[]
will be
coerced to LocalTime[]
.
pos
- the positiondefault java.time.LocalDateTime[] getArrayOfLocalDateTimes(int pos)
LocalDateTime
value at pos
.pos
- the positiondefault java.time.OffsetTime[] getArrayOfOffsetTimes(int pos)
OffsetTime
value at pos
.
Target element instance of OffsetDateTime[]
will be
coerced to OffsetTime[]
.
pos
- the positiondefault java.time.OffsetDateTime[] getArrayOfOffsetDateTimes(int pos)
OffsetDateTime
value at pos
.pos
- the positiondefault Buffer[] getArrayOfBuffers(int pos)
Buffer
value at pos
.pos
- the positiondefault UUID[] getArrayOfUUIDs(int pos)
UUID
value at pos
.pos
- the columndefault BigDecimal[] getArrayOfBigDecimals(int pos)
BigDecimal
value at pos
.pos
- the columnTuple addValue(Object value)
value
- the valuedefault Tuple addBoolean(Boolean value)
value
- the valuedefault Tuple addShort(Short value)
value
- the valuedefault Tuple addInteger(Integer value)
value
- the valuedefault Tuple addLong(Long value)
value
- the valuedefault Tuple addFloat(Float value)
value
- the valuedefault Tuple addDouble(Double value)
value
- the valuedefault Tuple addString(String value)
value
- the valuedefault Tuple addJsonObject(JsonObject value)
JsonObject
value at the end of the tuple.value
- the valuedefault Tuple addJsonArray(JsonArray value)
JsonArray
value at the end of the tuple.value
- the valuedefault Tuple addTemporal(java.time.temporal.Temporal value)
Temporal
value at the end of the tuple.value
- the valuedefault Tuple addLocalDate(java.time.LocalDate value)
LocalDate
value at the end of the tuple.value
- the valuedefault Tuple addLocalTime(java.time.LocalTime value)
LocalTime
value at the end of the tuple.value
- the valuedefault Tuple addLocalDateTime(java.time.LocalDateTime value)
LocalDateTime
value at the end of the tuple.value
- the valuedefault Tuple addOffsetTime(java.time.OffsetTime value)
OffsetTime
value at the end of the tuple.value
- the valuedefault Tuple addOffsetDateTime(java.time.OffsetDateTime value)
OffsetDateTime
value at the end of the tuple.value
- the valuedefault Tuple addBuffer(Buffer value)
value
- the valuedefault Tuple addUUID(UUID value)
UUID
value at the end of the tuple.value
- the valuedefault Tuple addBigDecimal(BigDecimal value)
BigDecimal
value at the end of the tuple.value
- the valuedefault Tuple addArrayOfBoolean(Boolean[] value)
Boolean
value at the end of the tuple.value
- the valuedefault Tuple addArrayOfShort(Short[] value)
Short
value at the end of the tuple.value
- the valuedefault Tuple addArrayOfInteger(Integer[] value)
Integer
value at the end of the tuple.
Target element instance of Number[]
will be
coerced to Integer[]
.
value
- the valuedefault Tuple addArrayOfLong(Long[] value)
Long
value at the end of the tuple.value
- the valuedefault Tuple addArrayOfFloat(Float[] value)
Float
value at the end of the tuple.value
- the valuedefault Tuple addArrayOfDouble(Double[] value)
Double
value at the end of the tuple.value
- the valuedefault Tuple addArrayOfString(String[] value)
String
value at the end of the tuple.value
- the valuedefault Tuple addArrayOfJsonObject(JsonObject[] value)
JsonObject
value at the end of the tuple.value
- the valuedefault Tuple addArrayOfJsonArray(JsonArray[] value)
JsonArray
value at the end of the tuple.value
- the valuedefault Tuple addArrayOfTemporal(java.time.temporal.Temporal[] value)
Temporal
value at the end of the tuple.value
- the valuedefault Tuple addArrayOfLocalDate(java.time.LocalDate[] value)
LocalDate
value at the end of the tuple.value
- the valuedefault Tuple addArrayOfLocalTime(java.time.LocalTime[] value)
LocalTime
value at the end of the tuple.value
- the valuedefault Tuple addArrayOfLocalDateTime(java.time.LocalDateTime[] value)
LocalDateTime
value at the end of the tuple.value
- the valuedefault Tuple addArrayOfOffsetTime(java.time.OffsetTime[] value)
OffsetTime
value at the end of the tuple.value
- the valuedefault Tuple addArrayOfOffsetDateTime(java.time.OffsetDateTime[] value)
OffsetDateTime
value at the end of the tuple.value
- the valuedefault Tuple addArrayOfBuffer(Buffer[] value)
Buffer
value at the end of the tuple.value
- the valuedefault Tuple addArrayOfUUID(UUID[] value)
UUID
value at the end of the tuple.value
- the valuedefault Tuple addArrayOfBigDecimal(BigDecimal[] value)
BigDecimal
value at the end of the tuple.value
- the valuedefault <T> T get(Class<T> type, int position)
position
and the specified type
.
The type can be one of the types returned by the row (e.g String.class
) or an array
of the type (e.g String[].class
)).
type
- the expected value typeposition
- the value positionint size()
void clear()
default String deepToString()
Object.toString()
value of each element,
separated by a comma (,) characterCopyright © 2023 Eclipse. All rights reserved.