Class AbstractStructReader

public abstract class AbstractStructReader implements StructReader

Base class for assisting StructReader implementations.

This class implements the majority of the StructReader interface, leaving subclasses to implement core data access via the getTypeNameInternal() methods. AbstractStructReader guarantees that these will only be called for non-NULL columns of a type appropriate for the method.

Inheritance

Object > AbstractStructReader

Implements

StructReader

Constructors

AbstractStructReader()

public AbstractStructReader()

Methods

checkNonNull(int columnIndex, Object columnNameForError)

protected void checkNonNull(int columnIndex, Object columnNameForError)
Parameters
NameDescription
columnIndexint
columnNameForErrorObject

getBigDecimal(int columnIndex)

public BigDecimal getBigDecimal(int columnIndex)

Returns the value of a non-NULL column with type Type#numeric().

Parameter
NameDescription
columnIndexint
Returns
TypeDescription
BigDecimal

getBigDecimal(String columnName)

public BigDecimal getBigDecimal(String columnName)

Returns the value of a non-NULL column with type Type#numeric().

Parameter
NameDescription
columnNameString
Returns
TypeDescription
BigDecimal

getBigDecimalInternal(int columnIndex)

protected abstract BigDecimal getBigDecimalInternal(int columnIndex)
Parameter
NameDescription
columnIndexint
Returns
TypeDescription
BigDecimal

getBigDecimalList(int columnIndex)

public List<BigDecimal> getBigDecimalList(int columnIndex)

Returns the value of a non-NULL column with type Type.array(Type.numeric()).

Parameter
NameDescription
columnIndexint
Returns
TypeDescription
List<BigDecimal>

getBigDecimalList(String columnName)

public List<BigDecimal> getBigDecimalList(String columnName)

Returns the value of a non-NULL column with type Type.array(Type.numeric()).

Parameter
NameDescription
columnNameString
Returns
TypeDescription
List<BigDecimal>

getBigDecimalListInternal(int columnIndex)

protected abstract List<BigDecimal> getBigDecimalListInternal(int columnIndex)
Parameter
NameDescription
columnIndexint
Returns
TypeDescription
List<BigDecimal>

getBoolean(int columnIndex)

public boolean getBoolean(int columnIndex)

Returns the value of a non-NULL column with type Type#bool().

Parameter
NameDescription
columnIndexint
Returns
TypeDescription
boolean

getBoolean(String columnName)

public boolean getBoolean(String columnName)

Returns the value of a non-NULL column with type Type#bool().

Parameter
NameDescription
columnNameString
Returns
TypeDescription
boolean

getBooleanArray(int columnIndex)

public boolean[] getBooleanArray(int columnIndex)

Returns the value of a non-NULL column with type Type.array(Type.bool()).

Parameter
NameDescription
columnIndexint
Returns
TypeDescription
boolean[]

getBooleanArray(String columnName)

public boolean[] getBooleanArray(String columnName)

Returns the value of a non-NULL column with type Type.array(Type.bool()).

Parameter
NameDescription
columnNameString
Returns
TypeDescription
boolean[]

getBooleanArrayInternal(int columnIndex)

protected abstract boolean[] getBooleanArrayInternal(int columnIndex)
Parameter
NameDescription
columnIndexint
Returns
TypeDescription
boolean[]

getBooleanInternal(int columnIndex)

protected abstract boolean getBooleanInternal(int columnIndex)
Parameter
NameDescription
columnIndexint
Returns
TypeDescription
boolean

getBooleanList(int columnIndex)

public List<Boolean> getBooleanList(int columnIndex)

Returns the value of a non-NULL column with type Type.array(Type.bool()).

Parameter
NameDescription
columnIndexint
Returns
TypeDescription
List<Boolean>

getBooleanList(String columnName)

public List<Boolean> getBooleanList(String columnName)

Returns the value of a non-NULL column with type Type.array(Type.bool()).

Parameter
NameDescription
columnNameString
Returns
TypeDescription
List<Boolean>

getBooleanListInternal(int columnIndex)

protected abstract List<Boolean> getBooleanListInternal(int columnIndex)
Parameter
NameDescription
columnIndexint
Returns
TypeDescription
List<Boolean>

getBytes(int columnIndex)

public ByteArray getBytes(int columnIndex)

Returns the value of a non-NULL column with type Type#bytes().

Parameter
NameDescription
columnIndexint
Returns
TypeDescription
com.google.cloud.ByteArray

getBytes(String columnName)

public ByteArray getBytes(String columnName)

Returns the value of a non-NULL column with type Type#bytes().

Parameter
NameDescription
columnNameString
Returns
TypeDescription
com.google.cloud.ByteArray

getBytesInternal(int columnIndex)

protected abstract ByteArray getBytesInternal(int columnIndex)
Parameter
NameDescription
columnIndexint
Returns
TypeDescription
com.google.cloud.ByteArray

getBytesList(int columnIndex)

public List<ByteArray> getBytesList(int columnIndex)

Returns the value of a non-NULL column with type Type.array(Type.bytes()).

Parameter
NameDescription
columnIndexint
Returns
TypeDescription
List<com.google.cloud.ByteArray>

getBytesList(String columnName)

public List<ByteArray> getBytesList(String columnName)

Returns the value of a non-NULL column with type Type.array(Type.bytes()).

Parameter
NameDescription
columnNameString
Returns
TypeDescription
List<com.google.cloud.ByteArray>

getBytesListInternal(int columnIndex)

protected abstract List<ByteArray> getBytesListInternal(int columnIndex)
Parameter
NameDescription
columnIndexint
Returns
TypeDescription
List<com.google.cloud.ByteArray>

getColumnCount()

public int getColumnCount()

Returns the number of columns in the underlying data. This includes any columns with NULL values.

Returns
TypeDescription
int

getColumnIndex(String columnName)

public int getColumnIndex(String columnName)

Returns the index of the column named columnName.

Parameter
NameDescription
columnNameString
Returns
TypeDescription
int

getColumnType(int columnIndex)

public Type getColumnType(int columnIndex)

Returns the type of a column.

Parameter
NameDescription
columnIndexint
Returns
TypeDescription
Type

getColumnType(String columnName)

public Type getColumnType(String columnName)

Returns the type of a column.

Parameter
NameDescription
columnNameString
Returns
TypeDescription
Type

getDate(int columnIndex)

public Date getDate(int columnIndex)

Returns the value of a non-NULL column with type Type#date().

Parameter
NameDescription
columnIndexint
Returns
TypeDescription
com.google.cloud.Date

getDate(String columnName)

public Date getDate(String columnName)

Returns the value of a non-NULL column with type Type#date().

Parameter
NameDescription
columnNameString
Returns
TypeDescription
com.google.cloud.Date

getDateInternal(int columnIndex)

protected abstract Date getDateInternal(int columnIndex)
Parameter
NameDescription
columnIndexint
Returns
TypeDescription
com.google.cloud.Date

getDateList(int columnIndex)

public List<Date> getDateList(int columnIndex)

Returns the value of a non-NULL column with type Type.array(Type.date()).

Parameter
NameDescription
columnIndexint
Returns
TypeDescription
List<com.google.cloud.Date>

getDateList(String columnName)

public List<Date> getDateList(String columnName)

Returns the value of a non-NULL column with type Type.array(Type.date()).

Parameter
NameDescription
columnNameString
Returns
TypeDescription
List<com.google.cloud.Date>

getDateListInternal(int columnIndex)

protected abstract List<Date> getDateListInternal(int columnIndex)
Parameter
NameDescription
columnIndexint
Returns
TypeDescription
List<com.google.cloud.Date>

getDouble(int columnIndex)

public double getDouble(int columnIndex)

Returns the value of a non-NULL column with type Type#float64().

Parameter
NameDescription
columnIndexint
Returns
TypeDescription
double

getDouble(String columnName)

public double getDouble(String columnName)

Returns the value of a non-NULL column with type Type#float64().

Parameter
NameDescription
columnNameString
Returns
TypeDescription
double

getDoubleArray(int columnIndex)

public double[] getDoubleArray(int columnIndex)

Returns the value of a non-NULL column with type Type.array(Type.float64()).

Parameter
NameDescription
columnIndexint
Returns
TypeDescription
double[]

getDoubleArray(String columnName)

public double[] getDoubleArray(String columnName)

Returns the value of a non-NULL column with type Type.array(Type.float64()).

Parameter
NameDescription
columnNameString
Returns
TypeDescription
double[]

getDoubleArrayInternal(int columnIndex)

protected abstract double[] getDoubleArrayInternal(int columnIndex)
Parameter
NameDescription
columnIndexint
Returns
TypeDescription
double[]

getDoubleInternal(int columnIndex)

protected abstract double getDoubleInternal(int columnIndex)
Parameter
NameDescription
columnIndexint
Returns
TypeDescription
double

getDoubleList(int columnIndex)

public List<Double> getDoubleList(int columnIndex)

Returns the value of a non-NULL column with type Type.array(Type.float64()).

Parameter
NameDescription
columnIndexint
Returns
TypeDescription
List<Double>

getDoubleList(String columnName)

public List<Double> getDoubleList(String columnName)

Returns the value of a non-NULL column with type Type.array(Type.float64()).

Parameter
NameDescription
columnNameString
Returns
TypeDescription
List<Double>

getDoubleListInternal(int columnIndex)

protected abstract List<Double> getDoubleListInternal(int columnIndex)
Parameter
NameDescription
columnIndexint
Returns
TypeDescription
List<Double>

getJson(int columnIndex)

public String getJson(int columnIndex)

Returns the value of a non-NULL column with type Type#string().

Parameter
NameDescription
columnIndexint
Returns
TypeDescription
String

getJson(String columnName)

public String getJson(String columnName)

Returns the value of a non-NULL column with type Type#string().

Parameter
NameDescription
columnNameString
Returns
TypeDescription
String

getJsonInternal(int columnIndex)

protected String getJsonInternal(int columnIndex)
Parameter
NameDescription
columnIndexint
Returns
TypeDescription
String

getJsonList(int columnIndex)

public List<String> getJsonList(int columnIndex)

Returns the value of a non-NULL column with type Type.array(Type.string()).

Parameter
NameDescription
columnIndexint
Returns
TypeDescription
List<String>

getJsonList(String columnName)

public List<String> getJsonList(String columnName)

Returns the value of a non-NULL column with type Type.array(Type.string()).

Parameter
NameDescription
columnNameString
Returns
TypeDescription
List<String>

getJsonListInternal(int columnIndex)

protected List<String> getJsonListInternal(int columnIndex)
Parameter
NameDescription
columnIndexint
Returns
TypeDescription
List<String>

getLong(int columnIndex)

public long getLong(int columnIndex)

Returns the value of a non-NULL column with type Type#int64().

Parameter
NameDescription
columnIndexint
Returns
TypeDescription
long

getLong(String columnName)

public long getLong(String columnName)

Returns the value of a non-NULL column with type Type#int64().

Parameter
NameDescription
columnNameString
Returns
TypeDescription
long

getLongArray(int columnIndex)

public long[] getLongArray(int columnIndex)

Returns the value of a non-NULL column with type Type.array(Type.int64()).

Parameter
NameDescription
columnIndexint
Returns
TypeDescription
long[]

getLongArray(String columnName)

public long[] getLongArray(String columnName)

Returns the value of a non-NULL column with type Type.array(Type.int64()).

Parameter
NameDescription
columnNameString
Returns
TypeDescription
long[]

getLongArrayInternal(int columnIndex)

protected abstract long[] getLongArrayInternal(int columnIndex)
Parameter
NameDescription
columnIndexint
Returns
TypeDescription
long[]

getLongInternal(int columnIndex)

protected abstract long getLongInternal(int columnIndex)
Parameter
NameDescription
columnIndexint
Returns
TypeDescription
long

getLongList(int columnIndex)

public List<Long> getLongList(int columnIndex)

Returns the value of a non-NULL column with type Type.array(Type.int64()).

Parameter
NameDescription
columnIndexint
Returns
TypeDescription
List<Long>

getLongList(String columnName)

public List<Long> getLongList(String columnName)

Returns the value of a non-NULL column with type Type.array(Type.int64()).

Parameter
NameDescription
columnNameString
Returns
TypeDescription
List<Long>

getLongListInternal(int columnIndex)

protected abstract List<Long> getLongListInternal(int columnIndex)
Parameter
NameDescription
columnIndexint
Returns
TypeDescription
List<Long>

getString(int columnIndex)

public String getString(int columnIndex)

Returns the value of a non-NULL column with type Type#string().

Parameter
NameDescription
columnIndexint
Returns
TypeDescription
String

getString(String columnName)

public String getString(String columnName)

Returns the value of a non-NULL column with type Type#string().

Parameter
NameDescription
columnNameString
Returns
TypeDescription
String

getStringInternal(int columnIndex)

protected abstract String getStringInternal(int columnIndex)
Parameter
NameDescription
columnIndexint
Returns
TypeDescription
String

getStringList(int columnIndex)

public List<String> getStringList(int columnIndex)

Returns the value of a non-NULL column with type Type.array(Type.string()).

Parameter
NameDescription
columnIndexint
Returns
TypeDescription
List<String>

getStringList(String columnName)

public List<String> getStringList(String columnName)

Returns the value of a non-NULL column with type Type.array(Type.string()).

Parameter
NameDescription
columnNameString
Returns
TypeDescription
List<String>

getStringListInternal(int columnIndex)

protected abstract List<String> getStringListInternal(int columnIndex)
Parameter
NameDescription
columnIndexint
Returns
TypeDescription
List<String>

getStructList(int columnIndex)

public List<Struct> getStructList(int columnIndex)

Returns the value of a non-NULL column with type Type.array(Type.struct(...)).

Parameter
NameDescription
columnIndexint
Returns
TypeDescription
List<Struct>

getStructList(String columnName)

public List<Struct> getStructList(String columnName)

Returns the value of a non-NULL column with type Type.array(Type.struct(...)).

Parameter
NameDescription
columnNameString
Returns
TypeDescription
List<Struct>

getStructListInternal(int columnIndex)

protected abstract List<Struct> getStructListInternal(int columnIndex)
Parameter
NameDescription
columnIndexint
Returns
TypeDescription
List<Struct>

getTimestamp(int columnIndex)

public Timestamp getTimestamp(int columnIndex)

Returns the value of a non-NULL column with type Type#timestamp().

Parameter
NameDescription
columnIndexint
Returns
TypeDescription
com.google.cloud.Timestamp

getTimestamp(String columnName)

public Timestamp getTimestamp(String columnName)

Returns the value of a non-NULL column with type Type#timestamp().

Parameter
NameDescription
columnNameString
Returns
TypeDescription
com.google.cloud.Timestamp

getTimestampInternal(int columnIndex)

protected abstract Timestamp getTimestampInternal(int columnIndex)
Parameter
NameDescription
columnIndexint
Returns
TypeDescription
com.google.cloud.Timestamp

getTimestampList(int columnIndex)

public List<Timestamp> getTimestampList(int columnIndex)

Returns the value of a non-NULL column with type Type.array(Type.timestamp()).

Parameter
NameDescription
columnIndexint
Returns
TypeDescription
List<com.google.cloud.Timestamp>

getTimestampList(String columnName)

public List<Timestamp> getTimestampList(String columnName)

Returns the value of a non-NULL column with type Type.array(Type.timestamp()).

Parameter
NameDescription
columnNameString
Returns
TypeDescription
List<com.google.cloud.Timestamp>

getTimestampListInternal(int columnIndex)

protected abstract List<Timestamp> getTimestampListInternal(int columnIndex)
Parameter
NameDescription
columnIndexint
Returns
TypeDescription
List<com.google.cloud.Timestamp>

getValue(int columnIndex)

public Value getValue(int columnIndex)

Returns the value of a nullable column as a Value.

Parameter
NameDescription
columnIndexint
Returns
TypeDescription
Value

getValue(String columnName)

public Value getValue(String columnName)

Returns the value of a nullable column as a Value.

Parameter
NameDescription
columnNameString
Returns
TypeDescription
Value

getValueInternal(int columnIndex)

protected Value getValueInternal(int columnIndex)
Parameter
NameDescription
columnIndexint
Returns
TypeDescription
Value

isNull(String columnName)

public boolean isNull(String columnName)

Returns true if a column contains a NULL value.

Parameter
NameDescription
columnNameString
Returns
TypeDescription
boolean