Interface Tuple


public interface Tuple
Interface for extracting the elements of a query result tuple.
Since:
6.0.0
  • Method Summary

    Modifier and Type
    Method
    Description
    get(int i)
    Returns the value of the element at the specified position in the result tuple.
    <X> X
    get(int i, Class<X> type)
    Returns the value of the element at the specified position in the result tuple.
    get(String alias)
    Returns the value of the tuple element to which the specified alias has been assigned.
    <X> X
    get(String alias, Class<X> type)
    Returns the value of the tuple element to which the specified alias has been assigned.
    Returns the values of the result tuple elements as an array.
  • Method Details

    • get

      <X> X get(String alias, Class<X> type)
      Returns the value of the tuple element to which the specified alias has been assigned. See SQL documentation to have more information about the mapping between SQL and Java types.
      Parameters:
      alias - alias assigned to the tuple element
      type - type of the tuple element
      Returns:
      the value of the tuple element
      Throws:
      IllegalArgumentException - if the alias does not correspond to an element in the query result tuple, or if element cannot be assigned to the specified type
    • get

      Object get(String alias)
      Returns the value of the tuple element to which the specified alias has been assigned.
      Parameters:
      alias - alias assigned to the tuple element
      Returns:
      value of the tuple element
      Throws:
      IllegalArgumentException - if alias does not correspond to an element in the query result tuple
    • get

      <X> X get(int i, Class<X> type)
      Returns the value of the element at the specified position in the result tuple. The first position is 0. See SQL documentation to have more information about the mapping between SQL and Java types.
      Parameters:
      i - position in result tuple
      type - type of the tuple element
      Returns:
      value of the tuple element
      Throws:
      IllegalArgumentException - if i exceeds length of result tuple or element cannot be assigned to the specified type
    • get

      Object get(int i)
      Returns the value of the element at the specified position in the result tuple. The first position is 0.
      Parameters:
      i - position in result tuple
      Returns:
      value of the tuple element
      Throws:
      IllegalArgumentException - if i exceeds length of result tuple
    • toArray

      Object[] toArray()
      Returns the values of the result tuple elements as an array.
      Returns:
      tuple element values