Row Class
Wraps a single Data 360 SQL query result row and provides typed accessor methods for retrieving column values by name or by 0-based index. Row instances are produced by SqlRowIterator and SqlQueueable; you don’t construct Row objects directly during normal usage.
Every typed accessor is available in two forms: by column name (String) or by 0-based column index (Integer). All typed accessors return null when the underlying value is null. The accessors throw IllegalArgumentException if the column name isn’t found or if the column index is out of bounds. Duplicate column names in a result set cause getColumnIndex() to throw IllegalArgumentException.
Access column values by name and by index:
The following are constructors for Row.
Creates a Row from a raw API row and column metadata. In normal usage you don’t construct Row objects directly — they’re produced by SqlRowIterator and SqlQueueable.
public Row(ConnectApi.QuerySqlRow rawRow, List<ConnectApi.QuerySqlMetadataItem> metadata)
-
rawRow:
Type: ConnectApi.QuerySqlRow
Raw API row from a
ConnectApi.QuerySqlPageOutputresult. -
metadata:
Type: List<ConnectApi.QuerySqlMetadataItem>
Column metadata for the result set, used to map column names to indexes.
The following are methods for Row.
Returns the value of the column at the specified 0-based index as a Boolean. Returns null if the column value is null. Throws IllegalArgumentException if the column index is out of bounds.
public Boolean getBoolean(Integer columnIndex)
-
columnIndex:
Type: Integer 0-based column index.
Type: Boolean
The column value as a Boolean, or null.
Returns the value of the specified column as a Boolean. Returns null if the column value is null. Throws IllegalArgumentException if the column name is not found.
public Boolean getBoolean(String columnName)
-
columnName:
Type: String
Column name.
Type: Boolean
The column value as a Boolean, or null.
Returns the 0-based index of the specified column name in the result set. Use this to look up an index once and then access multiple rows efficiently using index-based getters. Throws IllegalArgumentException if the column names are repeated in the table.
public Integer getColumnIndex(String columnName)
-
columnName:
Type: String
Name of the column to look up.
Type: Integer
The 0-based column index, or -1 if the column name is not found.
Returns the value of the column at the specified 0-based index as a Date. Returns null if the column value is null. Throws IllegalArgumentException if the column index is out of bounds.
public Date getDate(Integer columnIndex)
-
columnIndex:
Type: Integer 0-based column index.
Type: Date
The column value as a Date, or null.
Returns the value of the specified column as a Date. Returns null if the column value is null. Throws IllegalArgumentException if the column name is not found.
public Date getDate(String columnName)
-
columnName:
Type: String
Column name.
Type: Date
The column value as a Date, or null.
Returns the value of the column at the specified 0-based index as a Datetime. Returns null if the column value is null. Throws IllegalArgumentException if the column index is out of bounds.
public Datetime getDateTime(Integer columnIndex)
-
columnIndex:
Type: Integer 0-based column index.
Type: Datetime
The column value as a Datetime, or null.
Returns the value of the specified column as a Datetime. Returns null if the column value is null. Throws IllegalArgumentException if the column name is not found.
public Datetime getDateTime(String columnName)
-
columnName:
Type: String
Column name.
Type: Datetime
The column value as a Datetime, or null.
Returns the value of the column at the specified 0-based index as a Decimal. Returns null if the column value is null. Throws IllegalArgumentException if the column index is out of bounds.
public Decimal getDecimal(Integer columnIndex)
-
columnIndex:
Type: Integer 0-based column index.
Type: Decimal
The column value as a Decimal, or null.
Returns the value of the specified column as a Decimal. Returns null if the column value is null. Throws IllegalArgumentException if the column name is not found.
public Decimal getDecimal(String columnName)
-
columnName:
Type: String
Column name.
Type: Decimal
The column value as a Decimal, or null.
Returns the value of the column at the specified 0-based index as a Double. Returns null if the column value is null. Throws IllegalArgumentException if the column index is out of bounds.
public Double getDouble(Integer columnIndex)
-
columnIndex:
Type: Integer 0-based column index.
Type: Double
The column value as a Double, or null.
Returns the value of the specified column as a Double. Returns null if the column value is null. Throws IllegalArgumentException if the column name is not found.
public Double getDouble(String columnName)
-
columnName:
Type: String
Column name.
Type: Double
The column value as a Double, or null.
Returns the value of the column at the specified 0-based index as an Integer. Returns null if the column value is null. Throws IllegalArgumentException if the column index is out of bounds.
public Integer getInteger(Integer columnIndex)
-
columnIndex:
Type: Integer 0-based column index.
Type: Integer
The column value as an Integer, or null.
Returns the value of the specified column as an Integer. Returns null if the column value is null. Throws IllegalArgumentException if the column name is not found.
public Integer getInteger(String columnName)
-
columnName:
Type: String
Column name.
Type: Integer
The column value as an Integer, or null.
Returns the value of the column at the specified 0-based index as a List<Object>. Returns null if the column value is null. Throws IllegalArgumentException if the column index is out of bounds.
public List<Object> getList(Integer columnIndex)
-
columnIndex:
Type: Integer 0-based column index.
Type: List<Object>
The column value as a List<Object>, or null.
Returns the value of the specified column as a List<Object>. Returns null if the column value is null. Throws IllegalArgumentException if the column name is not found.
public List<Object> getList(String columnName)
-
columnName:
Type: String
Column name.
Type: List<Object>
The column value as a List<Object>, or null.
Returns the value of the column at the specified 0-based index as a Long. Returns null if the column value is null. Throws IllegalArgumentException if the column index is out of bounds.
public Long getLong(Integer columnIndex)
-
columnIndex:
Type: Integer 0-based column index.
Type: Long
The column value as a Long, or null.
Returns the value of the specified column as a Long. Returns null if the column value is null. Throws IllegalArgumentException if the column name is not found.
public Long getLong(String columnName)
-
columnName:
Type: String
Column name.
Type: Long
The column value as a Long, or null.
Returns the value of the column at the specified 0-based index as an Object. Use this when the column type is unknown or when you need the raw untyped value. Returns null if the column value is null. Throws IllegalArgumentException if the column index is out of bounds.
public Object getObject(Integer columnIndex)
-
columnIndex:
Type: Integer 0-based column index.
Type: Object
The column value as an Object, or null.
Returns the value of the specified column as an Object. Use this when the column type is unknown or when you need the raw untyped value. Returns null if the column value is null. Throws IllegalArgumentException if the column name is not found.
public Object getObject(String columnName)
-
columnName:
Type: String
Column name.
Type: Object
The column value as an Object, or null.
Returns the underlying ConnectApi.QuerySqlRow object. Use this for direct access to the raw API response when the typed accessor methods don’t meet your needs.
public ConnectApi.QuerySqlRow getRawRow()
Type: ConnectApi.QuerySqlRow
The underlying ConnectApi.QuerySqlRow for this row.
Returns the value of the column at the specified 0-based index as a String. Returns null if the column value is null. Throws IllegalArgumentException if the column index is out of bounds.
public String getString(Integer columnIndex)
-
columnIndex:
Type: Integer 0-based column index.
Type: String
The column value as a String, or null.
Returns the value of the specified column as a String. Returns null if the column value is null. Throws IllegalArgumentException if the column name is not found.
public String getString(String columnName)
-
columnName:
Type: String
Column name.
Type: String
The column value as a String, or null.
Returns the value of the column at the specified 0-based index as a Time. Returns null if the column value is null. Throws IllegalArgumentException if the column index is out of bounds.
public Time getTime(Integer columnIndex)
-
columnIndex:
Type: Integer 0-based column index.
Type: Time
The column value as a Time, or null.
Returns the value of the specified column as a Time. Returns null if the column value is null. Throws IllegalArgumentException if the column name is not found.
public Time getTime(String columnName)
-
columnName:
Type: String
Column name.
Type: Time
The column value as a Time, or null.
Returns a string representation of this Row.
public String toString()
Type: String
A string representation of this Row.