public interface StructReader
Struct or com.google.cloud.bigtable.data.v2.models.sql.ResultSet.
This provides accessors for each valid type in the form of getTypeName(). Attempting
to call these methods for a column of another type will result in an IllegalStateException. Each method has an overload accepting both int column index and
String column Name. Attempting to call an index-based method with a non-existent index
will result in an IndexOutOfBoundsException. Attempting to call a columnName based getter
with a column name that does not appear exactly once in the set of fields will result in an
IllegalArgumentException. Attempting to access a column with a null value will result in
a NullPointerException; isNull(int) & isNull(String) can be used to
check for null values.
| Modifier and Type | Method and Description |
|---|---|
boolean |
getBoolean(int columnIndex) |
boolean |
getBoolean(String columnName) |
com.google.protobuf.ByteString |
getBytes(int columnIndex) |
com.google.protobuf.ByteString |
getBytes(String columnName) |
com.google.cloud.Date |
getDate(int columnIndex) |
com.google.cloud.Date |
getDate(String columnName) |
double |
getDouble(int columnIndex)
Getter for FLOAT_64 type Sql data
|
double |
getDouble(String columnName)
Getter for FLOAT_64 type Sql data
|
float |
getFloat(int columnIndex)
Getter for FLOAT_32 type Sql data
|
float |
getFloat(String columnName)
Getter for FLOAT_32 type Sql data
|
<ElemType> List<ElemType> |
getList(int columnIndex,
SqlType.Array<ElemType> arrayType) |
<ElemType> List<ElemType> |
getList(String columnName,
SqlType.Array<ElemType> arrayType) |
long |
getLong(int columnIndex) |
long |
getLong(String columnName) |
<K,V> Map<K,V> |
getMap(int columnIndex,
SqlType.Map<K,V> mapType) |
<K,V> Map<K,V> |
getMap(String columnName,
SqlType.Map<K,V> mapType) |
<EnumType extends com.google.protobuf.ProtocolMessageEnum> |
getProtoEnum(int columnIndex,
Function<Integer,EnumType> forNumber)
Returns the value of a non-
NULL column with a protobuf enum type. |
<EnumType extends com.google.protobuf.ProtocolMessageEnum> |
getProtoEnum(String columnName,
Function<Integer,EnumType> forNumber)
Returns the value of a non-
NULL column with a protobuf enum type. |
<MsgType extends com.google.protobuf.AbstractMessage> |
getProtoMessage(int columnIndex,
MsgType message)
Returns the value of a non-
NULL column with a protobuf message type. |
<MsgType extends com.google.protobuf.AbstractMessage> |
getProtoMessage(String columnName,
MsgType message)
Returns the value of a non-
NULL column with a protobuf message type. |
String |
getString(int columnIndex) |
String |
getString(String columnName) |
Struct |
getStruct(int columnIndex) |
Struct |
getStruct(String columnName) |
Instant |
getTimestamp(int columnIndex) |
Instant |
getTimestamp(String columnName) |
boolean |
isNull(int columnIndex) |
boolean |
isNull(String columnName) |
boolean isNull(int columnIndex)
columnIndex - index of the columntrue if the column contains a NULL valueboolean isNull(String columnName)
columnName - name of the columntrue if the column contains a NULL valueIllegalArgumentException - if there is not exactly one column with the given namecom.google.protobuf.ByteString getBytes(int columnIndex)
columnIndex - index of the columnByteString type value of a non-NULL columncom.google.protobuf.ByteString getBytes(String columnName)
columnName - name of the columnByteString type value of a non-NULL columnString getString(int columnIndex)
columnIndex - index of the columnString type value of a non-NULL columnString getString(String columnName)
columnName - name of the columnString type value of a non-NULL columnlong getLong(int columnIndex)
columnIndex - index of the columnlong type value of a non-NULL columnlong getLong(String columnName)
columnName - name of the columnlong type value of a non-NULL columndouble getDouble(int columnIndex)
columnIndex - index of the columndouble type value of a non-NULL columndouble getDouble(String columnName)
columnName - name of the columndouble type value of a non-NULL columnfloat getFloat(int columnIndex)
columnIndex - index of the columnfloat type value of a non-NULL columnfloat getFloat(String columnName)
columnName - name of the columnfloat type value of a non-NULL columnboolean getBoolean(int columnIndex)
columnIndex - index of the columnboolean type value of a non-NULL columnboolean getBoolean(String columnName)
columnName - name of the columnboolean type value of a non-NULL columnInstant getTimestamp(int columnIndex)
columnIndex - index of the columnInstant type value of a non-NULL columnInstant getTimestamp(String columnName)
columnName - name of the columnInstant type value of a non-NULL columncom.google.cloud.Date getDate(int columnIndex)
columnIndex - index of the columnDate type value of a non-NULL columncom.google.cloud.Date getDate(String columnName)
columnName - name of the columnDate type value of a non-NULL columnStruct getStruct(int columnIndex)
columnIndex - index of the columnStruct type value of a non-NULL columnStruct getStruct(String columnName)
columnName - name of the columnStruct type value of a non-NULL column<ElemType> List<ElemType> getList(int columnIndex, SqlType.Array<ElemType> arrayType)
ElemType - Java type of the list elementscolumnIndex - index of the columnList type value of a non-NULL column<ElemType> List<ElemType> getList(String columnName, SqlType.Array<ElemType> arrayType)
ElemType - Java type of the list elementscolumnName - name of the columnList type value of a non-NULL column<K,V> Map<K,V> getMap(int columnIndex, SqlType.Map<K,V> mapType)
K - Java type of the map keysV - Java type of the map valuescolumnIndex - index of the columnMap type value of a non-NULL column<K,V> Map<K,V> getMap(String columnName, SqlType.Map<K,V> mapType)
K - Java type of the map keysV - Java type of the map valuescolumnName - name of the columnMap type value of a non-NULL column@BetaApi(value="This feature is currently experimental and can change in the future")
<MsgType extends com.google.protobuf.AbstractMessage> MsgType getProtoMessage(int columnIndex,
MsgType message)
NULL column with a protobuf message type.MsgType - the message type.columnIndex - index of the column.message - an instance of the message. This is used to determine the message type and
parser. MyMessage.getDefaultInstance() can be used.@BetaApi(value="This feature is currently experimental and can change in the future") <MsgType extends com.google.protobuf.AbstractMessage> MsgType getProtoMessage(String columnName, MsgType message)
NULL column with a protobuf message type.MsgType - the message type.columnName - name of the column.message - an instance of the message. This is used to determine the message type and
parser. MyMessage.getDefaultInstance() can be used.@BetaApi(value="This feature is currently experimental and can change in the future")
<EnumType extends com.google.protobuf.ProtocolMessageEnum> EnumType getProtoEnum(int columnIndex,
Function<Integer,EnumType> forNumber)
NULL column with a protobuf enum type.EnumType - the enum type.columnIndex - index of the column.forNumber - a function to convert an integer to the enum value. This is usually MyEnum::forNumber.@BetaApi(value="This feature is currently experimental and can change in the future") <EnumType extends com.google.protobuf.ProtocolMessageEnum> EnumType getProtoEnum(String columnName, Function<Integer,EnumType> forNumber)
NULL column with a protobuf enum type.EnumType - the enum type.columnName - name of the column.forNumber - a function to convert an integer to the enum value. This is usually MyEnum::forNumber.Copyright © 2026 Google LLC. All rights reserved.