com.mysql.cj.result

## Interface Row

All Superinterfaces:
  ProtocolEntity

All Known Subinterfaces:
  ResultsetRow

    public interface Row
    extends ProtocolEntity

### Method Summary

All Methods Instance Methods Abstract Methods Default Methods
`default byte[]` `getBytes(int columnIndex)` Returns the value at the given column as a byte array.
`boolean` `getNull(int columnIndex)` Check whether a column is NULL and update the 'wasNull' status.
`<T> T` `getValue(int columnIndex, ValueFactory<T> vf)` Retrieve a value for the given column.
`default void` `setBytes(int columnIndex, byte[] value)` Sets the given byte array as a raw column value (only works currently with ByteArrayRow).
`default Row` `setMetadata(ColumnDefinition columnDefinition)` Set metadata to enable getValue functionality.
`boolean` `wasNull()` Was the last value retrieved a NULL value?

### Method Detail

#### getValue

    <T> T getValue(int columnIndex,
                   ValueFactory<T> vf)

Retrieve a value for the given column. This is the main facility to access values from the Row involving `ValueDecoder` and `ValueFactory` chain. Metadata must be set via Row constructor or `setMetadata(ColumnDefinition)` call before calling this method to allow correct columnIndex boundaries check and data type recognition.

Type Parameters:
  `T` - type to decode to
Parameters:
  `columnIndex` - index of column to retrieve value from (0-indexed, not JDBC 1-indexed)
  `vf` - value factory used to create the return value after decoding
Returns:
  The return value from the value factory

#### setMetadata

    default Row setMetadata(ColumnDefinition columnDefinition)

Set metadata to enable getValue functionality.

Parameters:
  `columnDefinition` - `ColumnDefinition`
Returns:
  `Row`

#### getBytes

    default byte[] getBytes(int columnIndex)

Returns the value at the given column as a byte array. The bytes represent the raw values returned by the server.

Parameters:
  `columnIndex` - index of column (starting at 0) to return from.
Returns:
  the value for the given column; if the value is SQL `NULL`, the value returned is `null`

#### setBytes

    default void setBytes(int columnIndex,
                          byte[] value)

Sets the given byte array as a raw column value (only works currently with ByteArrayRow).

Parameters:
  `columnIndex` - index of the column (starting at 0) to set to.
  `value` - the (raw) value to set

#### getNull

    boolean getNull(int columnIndex)

Check whether a column is NULL and update the 'wasNull' status.

Parameters:
  `columnIndex` - of the column value (starting at 0) to check.
Returns:
  true if the column value is NULL, false if not.

#### wasNull

    boolean wasNull()

Was the last value retrieved a NULL value?

Returns:
  true if the last retrieved value was NULL.

Copyright © 2016, 2024, Oracle and/or its affiliates.