Interface Tuple
- All Known Subinterfaces:
Row
public interface Tuple
A general purpose tuple.
CAUTION: indexes start at 0, not at 1.
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptiondefault TupleaddArrayOfBigDecimal(BigDecimal[] value) Add an array ofBigDecimalvalue at the end of the tuple.default TupleaddArrayOfBoolean(Boolean[] value) Add an array ofBooleanvalue at the end of the tuple.default TupleaddArrayOfBuffer(Buffer[] value) Add an array ofBuffervalue at the end of the tuple.default TupleaddArrayOfDouble(Double[] value) Add an array ofDoublevalue at the end of the tuple.default TupleaddArrayOfFloat(Float[] value) Add an array ofFloatvalue at the end of the tuple.default TupleaddArrayOfInteger(Integer[] value) Add an array ofIntegervalue at the end of the tuple.default TupleaddArrayOfJsonArray(JsonArray[] value) Add an array ofJsonArrayvalue at the end of the tuple.default TupleaddArrayOfJsonObject(JsonObject[] value) Add an array ofJsonObjectvalue at the end of the tuple.default TupleaddArrayOfLocalDate(LocalDate[] value) Add an array ofLocalDatevalue at the end of the tuple.default TupleaddArrayOfLocalDateTime(LocalDateTime[] value) Add an array ofLocalDateTimevalue at the end of the tuple.default TupleaddArrayOfLocalTime(LocalTime[] value) Add an array ofLocalTimevalue at the end of the tuple.default TupleaddArrayOfLong(Long[] value) Add an array ofLongvalue at the end of the tuple.default TupleaddArrayOfOffsetDateTime(OffsetDateTime[] value) Add an array ofOffsetDateTimevalue at the end of the tuple.default TupleaddArrayOfOffsetTime(OffsetTime[] value) Add an array ofOffsetTimevalue at the end of the tuple.default TupleaddArrayOfShort(Short[] value) Add an array ofShortvalue at the end of the tuple.default TupleaddArrayOfString(String[] value) Add an array ofStringvalue at the end of the tuple.default TupleaddArrayOfTemporal(Temporal[] value) Add an array ofTemporalvalue at the end of the tuple.default TupleaddArrayOfUUID(UUID[] value) Add an array ofUUIDvalue at the end of the tuple.default TupleaddBigDecimal(BigDecimal value) Add aBigDecimalvalue at the end of the tuple.default TupleaddBoolean(Boolean value) Add a boolean value at the end of the tuple.default TupleAdd a buffer value at the end of the tuple.default TupleAdd a double value at the end of the tuple.default TupleAdd a float value at the end of the tuple.default TupleaddInteger(Integer value) Add an integer value at the end of the tuple.default TupleaddJsonArray(JsonArray value) Add aJsonArrayvalue at the end of the tuple.default TupleaddJsonObject(JsonObject value) Add aJsonObjectvalue at the end of the tuple.default TupleaddLocalDate(LocalDate value) Add aLocalDatevalue at the end of the tuple.default TupleaddLocalDateTime(LocalDateTime value) Add aLocalDateTimevalue at the end of the tuple.default TupleaddLocalTime(LocalTime value) Add aLocalTimevalue at the end of the tuple.default TupleAdd a long value at the end of the tuple.default TupleaddOffsetDateTime(OffsetDateTime value) Add aOffsetDateTimevalue at the end of the tuple.default TupleaddOffsetTime(OffsetTime value) Add aOffsetTimevalue at the end of the tuple.default TupleAdd a short value at the end of the tuple.default TupleAdd a string value at the end of the tuple.default TupleaddTemporal(Temporal value) Add aTemporalvalue at the end of the tuple.default TupleAdd aUUIDvalue at the end of the tuple.Add an object value at the end of the tuple.voidclear()default Stringstatic TupleWrap the providedarraywith a tuple.static <T> TupleWrap the providedlistwith a tuple.default <T> TGet the the at the specifiedpositionand the specifiedtype.default BigDecimal[]getArrayOfBigDecimals(int pos) Get an array ofBigDecimalvalue atpos.default Boolean[]getArrayOfBooleans(int pos) Get an array ofBooleanvalue atpos.default Buffer[]getArrayOfBuffers(int pos) Get an array ofBuffervalue atpos.default Byte[]getArrayOfBytes(int pos) Get an array ofBytevalue atpos.default Double[]getArrayOfDoubles(int pos) Get an array ofDoublevalue atpos.default Float[]getArrayOfFloats(int pos) Get an array ofFloatvalue atpos.default Integer[]getArrayOfIntegers(int pos) Get an array ofIntegervalue atpos.default JsonArray[]getArrayOfJsonArrays(int pos) Get an array ofJsonArrayvalue atpos.default JsonObject[]getArrayOfJsonObjects(int pos) Get an array ofJsonObjectvalue atpos.default Object[]getArrayOfJsons(int pos) Get an array of JSON elements atpos, the element might benullor one of the following types: String Number JsonObject JsonArray Booleandefault LocalDate[]getArrayOfLocalDates(int pos) Get an array ofLocalDatevalue atpos.default LocalDateTime[]getArrayOfLocalDateTimes(int pos) Get an array ofLocalDateTimevalue atpos.default LocalTime[]getArrayOfLocalTimes(int pos) Get an array ofLocalTimevalue atpos.default Long[]getArrayOfLongs(int pos) Get an array ofLongvalue atpos.default Numeric[]getArrayOfNumerics(int pos) Get an array ofNumericvalue atpos.default OffsetDateTime[]getArrayOfOffsetDateTimes(int pos) Get an array ofOffsetDateTimevalue atpos.default OffsetTime[]getArrayOfOffsetTimes(int pos) Get an array ofOffsetTimevalue atpos.default Short[]getArrayOfShorts(int pos) Get an array ofShortvalue atpos.default String[]getArrayOfStrings(int pos) Get an array ofStringvalue atpos.default Temporal[]getArrayOfTemporals(int pos) Get an array ofTemporalvalue atpos.default UUID[]getArrayOfUUIDs(int pos) Get an array ofUUIDvalue atpos.default BigDecimalgetBigDecimal(int pos) GetBigDecimalvalue atpos.default BooleangetBoolean(int pos) Get a boolean value atpos.default BuffergetBuffer(int pos) Get a buffer value atpos.default BytegetByte(int pos) Get a byte value atpos.default DoublegetDouble(int pos) Get a double value atpos.default FloatgetFloat(int pos) Get a float value atpos.default IntegergetInteger(int pos) Get an integer value atpos.default ObjectgetJson(int pos) Get a JSON element atpos, the element might benullor one of the following types: String Number JsonObject JsonArray Booleandefault JsonArraygetJsonArray(int pos) Get aJsonArrayvalue atpos.default JsonObjectgetJsonObject(int pos) Get aJsonObjectvalue atpos.default LocalDategetLocalDate(int pos) GetLocalDatevalue atpos.default LocalDateTimegetLocalDateTime(int pos) GetLocalDateTimevalue atpos.default LocalTimegetLocalTime(int pos) GetLocalTimevalue atpos.default LonggetLong(int pos) Get a long value atpos.default NumericgetNumeric(int pos) GetNumericvalue atpos.default OffsetDateTimegetOffsetDateTime(int pos) GetOffsetDateTimevalue atpos.default OffsetTimegetOffsetTime(int pos) GetOffsetTimevalue atpos.default ShortgetShort(int pos) Get a short value atpos.default StringgetString(int pos) Get a string value atpos.default TemporalgetTemporal(int pos) Get aTemporalvalue atpos.default UUIDgetUUID(int pos) GetUUIDvalue atpos.getValue(int pos) Get an object value atpos.static TupleCreate a tuple of one element.static TupleCreate a tuple of two elements.static TupleCreate a tuple of an arbitrary number of elements.static TupleCreate a tuple of three elements.static TupleCreate a tuple of four elements.static TupleCreate a tuple of five elements.static TupleCreate a tuple of six elements.intsize()static Tupletuple()static TupleCreate a tuple with the providedelementslist.types()static TupleWrap the providedarraywith a tuple.static <T> TupleWrap the providedlistwith a tuple.
-
Field Details
-
JSON_NULL
The JSON null literal value.
It is used to distinguish a JSON null literal value from the Javanullvalue. This is only used when the database supports JSON types.
-
-
Method Details
-
tuple
- Returns:
- a new empty tuple
-
from
-
from
-
wrap
Wrap the providedlistwith a tuple.
The list is not copied and is used as store for tuple elements.
Note: The list might be modified and users should usetuple(List)if the list is unmodifiable- Returns:
- the list wrapped as a tuple
-
wrap
-
of
-
of
-
of
-
of
-
of
-
of
-
of
-
tuple
-
getValue
Get an object value atpos.- Parameters:
pos- the position- Returns:
- the value
-
getBoolean
Get a boolean value atpos.- Parameters:
pos- the position- Returns:
- the value
-
getByte
Get a byte value atpos.- Parameters:
pos- the position- Returns:
- the value
-
getShort
Get a short value atpos.- Parameters:
pos- the position- Returns:
- the value
-
getInteger
Get an integer value atpos.- Parameters:
pos- the position- Returns:
- the value
-
getLong
Get a long value atpos.- Parameters:
pos- the position- Returns:
- the value
-
getFloat
Get a float value atpos.- Parameters:
pos- the position- Returns:
- the value
-
getDouble
Get a double value atpos.- Parameters:
pos- the position- Returns:
- the value
-
getNumeric
-
getString
Get a string value atpos.- Parameters:
pos- the position- Returns:
- the value
-
getJsonObject
Get aJsonObjectvalue atpos.- Parameters:
pos- the position- Returns:
- the value
-
getJsonArray
-
getJson
-
getTemporal
-
getLocalDate
-
getLocalTime
-
getLocalDateTime
GetLocalDateTimevalue atpos.- Parameters:
pos- the position- Returns:
- the value
-
getOffsetTime
GetOffsetTimevalue atpos.Target element instance of
OffsetDateTimewill be coerced toOffsetTime.- Parameters:
pos- the position- Returns:
- the value
-
getOffsetDateTime
GetOffsetDateTimevalue atpos.- Parameters:
pos- the position- Returns:
- the value
-
getBuffer
Get a buffer value atpos.- Parameters:
pos- the position- Returns:
- the value
-
getUUID
-
getBigDecimal
GetBigDecimalvalue atpos.- Parameters:
pos- the position- Returns:
- the value
-
getArrayOfBooleans
-
getArrayOfBytes
-
getArrayOfShorts
-
getArrayOfIntegers
-
getArrayOfLongs
-
getArrayOfFloats
-
getArrayOfDoubles
-
getArrayOfNumerics
-
getArrayOfStrings
-
getArrayOfJsonObjects
Get an array ofJsonObjectvalue atpos.- Parameters:
pos- the position- Returns:
- the value
-
getArrayOfJsonArrays
-
getArrayOfJsons
-
getArrayOfTemporals
-
getArrayOfLocalDates
-
getArrayOfLocalTimes
-
getArrayOfLocalDateTimes
Get an array ofLocalDateTimevalue atpos.- Parameters:
pos- the position- Returns:
- the value
-
getArrayOfOffsetTimes
Get an array ofOffsetTimevalue atpos.Target element instance of
OffsetDateTime[]will be coerced toOffsetTime[].- Parameters:
pos- the position- Returns:
- the value
-
getArrayOfOffsetDateTimes
Get an array ofOffsetDateTimevalue atpos.- Parameters:
pos- the position- Returns:
- the value
-
getArrayOfBuffers
-
getArrayOfUUIDs
-
getArrayOfBigDecimals
Get an array ofBigDecimalvalue atpos.- Parameters:
pos- the column- Returns:
- the value
-
addValue
-
addBoolean
-
addShort
-
addInteger
-
addLong
-
addFloat
-
addDouble
-
addString
-
addJsonObject
Add aJsonObjectvalue at the end of the tuple.- Parameters:
value- the value- Returns:
- a reference to this, so the API can be used fluently
-
addJsonArray
-
addTemporal
-
addLocalDate
-
addLocalTime
-
addLocalDateTime
Add aLocalDateTimevalue at the end of the tuple.- Parameters:
value- the value- Returns:
- a reference to this, so the API can be used fluently
-
addOffsetTime
Add aOffsetTimevalue at the end of the tuple.- Parameters:
value- the value- Returns:
- a reference to this, so the API can be used fluently
-
addOffsetDateTime
Add aOffsetDateTimevalue at the end of the tuple.- Parameters:
value- the value- Returns:
- a reference to this, so the API can be used fluently
-
addBuffer
-
addUUID
-
addBigDecimal
Add aBigDecimalvalue at the end of the tuple.- Parameters:
value- the value- Returns:
- a reference to this, so the API can be used fluently
-
addArrayOfBoolean
-
addArrayOfShort
-
addArrayOfInteger
-
addArrayOfLong
-
addArrayOfFloat
-
addArrayOfDouble
-
addArrayOfString
-
addArrayOfJsonObject
Add an array ofJsonObjectvalue at the end of the tuple.- Parameters:
value- the value- Returns:
- a reference to this, so the API can be used fluently
-
addArrayOfJsonArray
-
addArrayOfTemporal
-
addArrayOfLocalDate
-
addArrayOfLocalTime
-
addArrayOfLocalDateTime
Add an array ofLocalDateTimevalue at the end of the tuple.- Parameters:
value- the value- Returns:
- a reference to this, so the API can be used fluently
-
addArrayOfOffsetTime
Add an array ofOffsetTimevalue at the end of the tuple.- Parameters:
value- the value- Returns:
- a reference to this, so the API can be used fluently
-
addArrayOfOffsetDateTime
Add an array ofOffsetDateTimevalue at the end of the tuple.- Parameters:
value- the value- Returns:
- a reference to this, so the API can be used fluently
-
addArrayOfBuffer
-
addArrayOfUUID
-
addArrayOfBigDecimal
Add an array ofBigDecimalvalue at the end of the tuple.- Parameters:
value- the value- Returns:
- a reference to this, so the API can be used fluently
-
get
Get the the at the specifiedpositionand the specifiedtype.The type can be one of the types returned by the row (e.g
String.class) or an array of the type (e.gString[].class)).- Parameters:
type- the expected value typeposition- the value position- Returns:
- the value if the value is found or null.
-
size
int size()- Returns:
- the tuple size
-
clear
void clear() -
types
-
deepToString
- Returns:
- A String containing the
Object.toString()value of each element, separated by a comma (,) character
-