Interface Row


  • public interface Row
    A single record, returned as part of a query result.
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      KsqlObject asObject()
      Returns the data in this row represented as a KsqlObject where keys are column names and values are column values.
      List<String> columnNames()
      Returns column names for the data in this row.
      List<ColumnType> columnTypes()
      Returns column types for the data in this row.
      Boolean getBoolean​(int columnIndex)
      Returns the value for a particular column of the Row as a boolean.
      Boolean getBoolean​(String columnName)
      Returns the value for a particular column of the Row as a boolean.
      byte[] getBytes​(int columnIndex)
      Returns the value for a particular column of the Row as a byte array.
      byte[] getBytes​(String columnName)
      Returns the value for a particular column of the Row as byte array.
      BigDecimal getDecimal​(int columnIndex)
      Returns the value for a particular column of the Row as a BigDecimal.
      BigDecimal getDecimal​(String columnName)
      Returns the value for a particular column of the Row as a BigDecimal.
      Double getDouble​(int columnIndex)
      Returns the value for a particular column of the Row as a double.
      Double getDouble​(String columnName)
      Returns the value for a particular column of the Row as a double.
      Integer getInteger​(int columnIndex)
      Returns the value for a particular column of the Row as an integer.
      Integer getInteger​(String columnName)
      Returns the value for a particular column of the Row as an integer.
      KsqlArray getKsqlArray​(int columnIndex)
      Returns the value for a particular column of the Row as a KsqlArray.
      KsqlArray getKsqlArray​(String columnName)
      Returns the value for a particular column of the Row as a KsqlArray.
      KsqlObject getKsqlObject​(int columnIndex)
      Returns the value for a particular column of the Row as a KsqlObject.
      KsqlObject getKsqlObject​(String columnName)
      Returns the value for a particular column of the Row as a KsqlObject.
      Long getLong​(int columnIndex)
      Returns the value for a particular column of the Row as a long.
      Long getLong​(String columnName)
      Returns the value for a particular column of the Row as a long.
      String getString​(int columnIndex)
      Returns the value for a particular column of the Row as a string.
      String getString​(String columnName)
      Returns the value for a particular column of the Row as a string.
      Object getValue​(int columnIndex)
      Returns the value for a particular column of the Row as an Object.
      Object getValue​(String columnName)
      Returns the value for a particular column of the Row as an Object.
      boolean isNull​(int columnIndex)
      Returns whether the value for a particular column of the Row is null.
      boolean isNull​(String columnName)
      Returns whether the value for a particular column of the Row is null.
      KsqlArray values()
      Returns the values (data) in this row, represented as a KsqlArray.
    • Method Detail

      • columnNames

        List<String> columnNames()
        Returns column names for the data in this row.
        Returns:
        the column names
      • columnTypes

        List<ColumnType> columnTypes()
        Returns column types for the data in this row.
        Returns:
        the column types
      • values

        KsqlArray values()
        Returns the values (data) in this row, represented as a KsqlArray.

        Returned values are JSON types which means numeric columns are not necessarily typed in accordance with columnTypes(). For example, a BIGINT field will be typed as an integer rather than a long, if the numeric value fits into an integer.

        Returns:
        the values
      • asObject

        KsqlObject asObject()
        Returns the data in this row represented as a KsqlObject where keys are column names and values are column values.
        Returns:
        the data
      • isNull

        boolean isNull​(int columnIndex)
        Returns whether the value for a particular column of the Row is null.
        Parameters:
        columnIndex - index of column (1-indexed)
        Returns:
        whether the column value is null
        Throws:
        IndexOutOfBoundsException - if the index is invalid
      • isNull

        boolean isNull​(String columnName)
        Returns whether the value for a particular column of the Row is null.
        Parameters:
        columnName - name of column
        Returns:
        whether the column value is null
        Throws:
        IllegalArgumentException - if the column name is invalid
      • getValue

        Object getValue​(int columnIndex)
        Returns the value for a particular column of the Row as an Object.
        Parameters:
        columnIndex - index of column (1-indexed)
        Returns:
        column value
        Throws:
        IndexOutOfBoundsException - if the index is invalid
      • getValue

        Object getValue​(String columnName)
        Returns the value for a particular column of the Row as an Object.
        Parameters:
        columnName - name of column
        Returns:
        column value
        Throws:
        IllegalArgumentException - if the column name is invalid
      • getString

        String getString​(int columnIndex)
        Returns the value for a particular column of the Row as a string.
        Parameters:
        columnIndex - index of column (1-indexed)
        Returns:
        column value
        Throws:
        ClassCastException - if the column value is not a string
        IndexOutOfBoundsException - if the index is invalid
      • getString

        String getString​(String columnName)
        Returns the value for a particular column of the Row as a string.
        Parameters:
        columnName - name of column
        Returns:
        column value
        Throws:
        ClassCastException - if the column value is not a string
        IllegalArgumentException - if the column name is invalid
      • getInteger

        Integer getInteger​(int columnIndex)
        Returns the value for a particular column of the Row as an integer.
        Parameters:
        columnIndex - index of column (1-indexed)
        Returns:
        column value
        Throws:
        ClassCastException - if the column value is not a Number
        IndexOutOfBoundsException - if the index is invalid
      • getInteger

        Integer getInteger​(String columnName)
        Returns the value for a particular column of the Row as an integer.
        Parameters:
        columnName - name of column
        Returns:
        column value
        Throws:
        ClassCastException - if the column value is not a Number
        IllegalArgumentException - if the column name is invalid
      • getLong

        Long getLong​(int columnIndex)
        Returns the value for a particular column of the Row as a long.
        Parameters:
        columnIndex - index of column (1-indexed)
        Returns:
        column value
        Throws:
        ClassCastException - if the column value is not a Number
        IndexOutOfBoundsException - if the index is invalid
      • getLong

        Long getLong​(String columnName)
        Returns the value for a particular column of the Row as a long.
        Parameters:
        columnName - name of column
        Returns:
        column value
        Throws:
        ClassCastException - if the column value is not a Number
        IllegalArgumentException - if the column name is invalid
      • getDouble

        Double getDouble​(int columnIndex)
        Returns the value for a particular column of the Row as a double.
        Parameters:
        columnIndex - index of column (1-indexed)
        Returns:
        column value
        Throws:
        ClassCastException - if the column value is not a Number
        IndexOutOfBoundsException - if the index is invalid
      • getDouble

        Double getDouble​(String columnName)
        Returns the value for a particular column of the Row as a double.
        Parameters:
        columnName - name of column
        Returns:
        column value
        Throws:
        ClassCastException - if the column value is not a Number
        IllegalArgumentException - if the column name is invalid
      • getBoolean

        Boolean getBoolean​(int columnIndex)
        Returns the value for a particular column of the Row as a boolean.
        Parameters:
        columnIndex - index of column (1-indexed)
        Returns:
        column value
        Throws:
        ClassCastException - if the column value is not a boolean
        IndexOutOfBoundsException - if the index is invalid
      • getBoolean

        Boolean getBoolean​(String columnName)
        Returns the value for a particular column of the Row as a boolean.
        Parameters:
        columnName - name of column
        Returns:
        column value
        Throws:
        ClassCastException - if the column value is not a boolean
        IllegalArgumentException - if the column name is invalid
      • getDecimal

        BigDecimal getDecimal​(int columnIndex)
        Returns the value for a particular column of the Row as a BigDecimal.
        Parameters:
        columnIndex - index of column (1-indexed)
        Returns:
        column value
        Throws:
        ClassCastException - if the column value is not a Number
        IndexOutOfBoundsException - if the index is invalid
      • getDecimal

        BigDecimal getDecimal​(String columnName)
        Returns the value for a particular column of the Row as a BigDecimal.
        Parameters:
        columnName - name of column
        Returns:
        column value
        Throws:
        ClassCastException - if the column value is not a Number
        IllegalArgumentException - if the column name is invalid
      • getBytes

        byte[] getBytes​(int columnIndex)
        Returns the value for a particular column of the Row as a byte array.
        Parameters:
        columnIndex - index of column (1-indexed)
        Returns:
        column value
        Throws:
        ClassCastException - if the column value is not a String
        IllegalArgumentException - if the column value is not a base64 encoded string
        IndexOutOfBoundsException - if the index is invalid
      • getBytes

        byte[] getBytes​(String columnName)
        Returns the value for a particular column of the Row as byte array.
        Parameters:
        columnName - name of column
        Returns:
        column value
        Throws:
        ClassCastException - if the column value is not a String
        IllegalArgumentException - if the column name is invalid or the column value is not a base64 encoded string
      • getKsqlObject

        KsqlObject getKsqlObject​(int columnIndex)
        Returns the value for a particular column of the Row as a KsqlObject. Useful for MAP and STRUCT column types.
        Parameters:
        columnIndex - index of column (1-indexed)
        Returns:
        column value
        Throws:
        ClassCastException - if the column value cannot be converted to a map
        IndexOutOfBoundsException - if the index is invalid
      • getKsqlObject

        KsqlObject getKsqlObject​(String columnName)
        Returns the value for a particular column of the Row as a KsqlObject. Useful for MAP and STRUCT column types.
        Parameters:
        columnName - name of column
        Returns:
        column value
        Throws:
        ClassCastException - if the column value cannot be converted to a map
        IllegalArgumentException - if the column name is invalid
      • getKsqlArray

        KsqlArray getKsqlArray​(int columnIndex)
        Returns the value for a particular column of the Row as a KsqlArray. Useful for ARRAY column types.
        Parameters:
        columnIndex - index of column (1-indexed)
        Returns:
        column value
        Throws:
        ClassCastException - if the column value cannot be converted to a list
        IndexOutOfBoundsException - if the index is invalid
      • getKsqlArray

        KsqlArray getKsqlArray​(String columnName)
        Returns the value for a particular column of the Row as a KsqlArray. Useful for ARRAY column types.
        Parameters:
        columnName - name of column
        Returns:
        column value
        Throws:
        ClassCastException - if the column value cannot be converted to a list
        IllegalArgumentException - if the column name is invalid