public abstract class AbstractStructReader extends Object implements StructReader
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.
| Constructor and Description |
|---|
AbstractStructReader() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
checkNonNull(int columnIndex,
Object columnNameForError) |
boolean |
getBoolean(int columnIndex)
Returns the value of a non-
NULL column with type Type.bool(). |
boolean |
getBoolean(String columnName)
Returns the value of a non-
NULL column with type Type.bool(). |
boolean[] |
getBooleanArray(int columnIndex)
Returns the value of a non-
NULL column with type Type.array(Type.bool()). |
boolean[] |
getBooleanArray(String columnName)
Returns the value of a non-
NULL column with type Type.array(Type.bool()). |
protected abstract boolean[] |
getBooleanArrayInternal(int columnIndex) |
protected abstract boolean |
getBooleanInternal(int columnIndex) |
List<Boolean> |
getBooleanList(int columnIndex)
Returns the value of a non-
NULL column with type Type.array(Type.bool()). |
List<Boolean> |
getBooleanList(String columnName)
Returns the value of a non-
NULL column with type Type.array(Type.bool()). |
protected abstract List<Boolean> |
getBooleanListInternal(int columnIndex) |
com.google.cloud.ByteArray |
getBytes(int columnIndex)
Returns the value of a non-
NULL column with type Type.bytes(). |
com.google.cloud.ByteArray |
getBytes(String columnName)
Returns the value of a non-
NULL column with type Type.bytes(). |
protected abstract com.google.cloud.ByteArray |
getBytesInternal(int columnIndex) |
List<com.google.cloud.ByteArray> |
getBytesList(int columnIndex)
Returns the value of a non-
NULL column with type Type.array(Type.bytes()). |
List<com.google.cloud.ByteArray> |
getBytesList(String columnName)
Returns the value of a non-
NULL column with type Type.array(Type.bytes()). |
protected abstract List<com.google.cloud.ByteArray> |
getBytesListInternal(int columnIndex) |
int |
getColumnCount()
Returns the number of columns in the underlying data.
|
int |
getColumnIndex(String columnName)
Returns the index of the column named
columnName. |
Type |
getColumnType(int columnIndex)
Returns the type of a column.
|
Type |
getColumnType(String columnName)
Returns the type of a column.
|
com.google.cloud.Date |
getDate(int columnIndex)
Returns the value of a non-
NULL column with type Type.date(). |
com.google.cloud.Date |
getDate(String columnName)
Returns the value of a non-
NULL column with type Type.date(). |
protected abstract com.google.cloud.Date |
getDateInternal(int columnIndex) |
List<com.google.cloud.Date> |
getDateList(int columnIndex)
Returns the value of a non-
NULL column with type Type.array(Type.date()). |
List<com.google.cloud.Date> |
getDateList(String columnName)
Returns the value of a non-
NULL column with type Type.array(Type.date()). |
protected abstract List<com.google.cloud.Date> |
getDateListInternal(int columnIndex) |
double |
getDouble(int columnIndex)
Returns the value of a non-
NULL column with type Type.float64(). |
double |
getDouble(String columnName)
Returns the value of a non-
NULL column with type Type.float64(). |
double[] |
getDoubleArray(int columnIndex)
Returns the value of a non-
NULL column with type Type.array(Type.float64()). |
double[] |
getDoubleArray(String columnName)
Returns the value of a non-
NULL column with type Type.array(Type.float64()). |
protected abstract double[] |
getDoubleArrayInternal(int columnIndex) |
protected abstract double |
getDoubleInternal(int columnIndex) |
List<Double> |
getDoubleList(int columnIndex)
Returns the value of a non-
NULL column with type Type.array(Type.float64()). |
List<Double> |
getDoubleList(String columnName)
Returns the value of a non-
NULL column with type Type.array(Type.float64()). |
protected abstract List<Double> |
getDoubleListInternal(int columnIndex) |
long |
getLong(int columnIndex)
Returns the value of a non-
NULL column with type Type.int64(). |
long |
getLong(String columnName)
Returns the value of a non-
NULL column with type Type.int64(). |
long[] |
getLongArray(int columnIndex)
Returns the value of a non-
NULL column with type Type.array(Type.int64()). |
long[] |
getLongArray(String columnName)
Returns the value of a non-
NULL column with type Type.array(Type.int64()). |
protected abstract long[] |
getLongArrayInternal(int columnIndex) |
protected abstract long |
getLongInternal(int columnIndex) |
List<Long> |
getLongList(int columnIndex)
Returns the value of a non-
NULL column with type Type.array(Type.int64()). |
List<Long> |
getLongList(String columnName)
Returns the value of a non-
NULL column with type Type.array(Type.int64()). |
protected abstract List<Long> |
getLongListInternal(int columnIndex) |
String |
getString(int columnIndex)
Returns the value of a non-
NULL column with type Type.string(). |
String |
getString(String columnName)
Returns the value of a non-
NULL column with type Type.string(). |
protected abstract String |
getStringInternal(int columnIndex) |
List<String> |
getStringList(int columnIndex)
Returns the value of a non-
NULL column with type Type.array(Type.string()). |
List<String> |
getStringList(String columnName)
Returns the value of a non-
NULL column with type Type.array(Type.string()). |
protected abstract List<String> |
getStringListInternal(int columnIndex) |
List<Struct> |
getStructList(int columnIndex)
Returns the value of a non-
NULL column with type Type.array(Type.struct(...)). |
List<Struct> |
getStructList(String columnName)
Returns the value of a non-
NULL column with type Type.array(Type.struct(...)). |
protected abstract List<Struct> |
getStructListInternal(int columnIndex) |
com.google.cloud.Timestamp |
getTimestamp(int columnIndex)
Returns the value of a non-
NULL column with type Type.timestamp(). |
com.google.cloud.Timestamp |
getTimestamp(String columnName)
Returns the value of a non-
NULL column with type Type.timestamp(). |
protected abstract com.google.cloud.Timestamp |
getTimestampInternal(int columnIndex) |
List<com.google.cloud.Timestamp> |
getTimestampList(int columnIndex)
Returns the value of a non-
NULL column with type Type.array(Type.timestamp()). |
List<com.google.cloud.Timestamp> |
getTimestampList(String columnName)
Returns the value of a non-
NULL column with type Type.array(Type.timestamp()). |
protected abstract List<com.google.cloud.Timestamp> |
getTimestampListInternal(int columnIndex) |
boolean |
isNull(String columnName)
Returns
true if a column contains a NULL value. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetType, isNullprotected abstract boolean getBooleanInternal(int columnIndex)
protected abstract long getLongInternal(int columnIndex)
protected abstract double getDoubleInternal(int columnIndex)
protected abstract String getStringInternal(int columnIndex)
protected abstract com.google.cloud.ByteArray getBytesInternal(int columnIndex)
protected abstract com.google.cloud.Timestamp getTimestampInternal(int columnIndex)
protected abstract com.google.cloud.Date getDateInternal(int columnIndex)
protected abstract boolean[] getBooleanArrayInternal(int columnIndex)
protected abstract long[] getLongArrayInternal(int columnIndex)
protected abstract double[] getDoubleArrayInternal(int columnIndex)
protected abstract List<com.google.cloud.ByteArray> getBytesListInternal(int columnIndex)
protected abstract List<com.google.cloud.Timestamp> getTimestampListInternal(int columnIndex)
protected abstract List<com.google.cloud.Date> getDateListInternal(int columnIndex)
public int getColumnCount()
StructReaderNULL values.getColumnCount in interface StructReaderpublic Type getColumnType(int columnIndex)
StructReadergetColumnType in interface StructReaderpublic Type getColumnType(String columnName)
StructReadergetColumnType in interface StructReaderpublic boolean isNull(String columnName)
StructReadertrue if a column contains a NULL value.isNull in interface StructReaderpublic boolean getBoolean(int columnIndex)
StructReaderNULL column with type Type.bool().getBoolean in interface StructReaderpublic boolean getBoolean(String columnName)
StructReaderNULL column with type Type.bool().getBoolean in interface StructReaderpublic long getLong(int columnIndex)
StructReaderNULL column with type Type.int64().getLong in interface StructReaderpublic long getLong(String columnName)
StructReaderNULL column with type Type.int64().getLong in interface StructReaderpublic double getDouble(int columnIndex)
StructReaderNULL column with type Type.float64().getDouble in interface StructReaderpublic double getDouble(String columnName)
StructReaderNULL column with type Type.float64().getDouble in interface StructReaderpublic String getString(int columnIndex)
StructReaderNULL column with type Type.string().getString in interface StructReaderpublic String getString(String columnName)
StructReaderNULL column with type Type.string().getString in interface StructReaderpublic com.google.cloud.ByteArray getBytes(int columnIndex)
StructReaderNULL column with type Type.bytes().getBytes in interface StructReaderpublic com.google.cloud.ByteArray getBytes(String columnName)
StructReaderNULL column with type Type.bytes().getBytes in interface StructReaderpublic com.google.cloud.Timestamp getTimestamp(int columnIndex)
StructReaderNULL column with type Type.timestamp().getTimestamp in interface StructReaderpublic com.google.cloud.Timestamp getTimestamp(String columnName)
StructReaderNULL column with type Type.timestamp().getTimestamp in interface StructReaderpublic com.google.cloud.Date getDate(int columnIndex)
StructReaderNULL column with type Type.date().getDate in interface StructReaderpublic com.google.cloud.Date getDate(String columnName)
StructReaderNULL column with type Type.date().getDate in interface StructReaderpublic boolean[] getBooleanArray(int columnIndex)
StructReaderNULL column with type Type.array(Type.bool()).getBooleanArray in interface StructReaderpublic boolean[] getBooleanArray(String columnName)
StructReaderNULL column with type Type.array(Type.bool()).getBooleanArray in interface StructReaderpublic List<Boolean> getBooleanList(int columnIndex)
StructReaderNULL column with type Type.array(Type.bool()).getBooleanList in interface StructReaderpublic List<Boolean> getBooleanList(String columnName)
StructReaderNULL column with type Type.array(Type.bool()).getBooleanList in interface StructReaderpublic long[] getLongArray(int columnIndex)
StructReaderNULL column with type Type.array(Type.int64()).getLongArray in interface StructReaderpublic long[] getLongArray(String columnName)
StructReaderNULL column with type Type.array(Type.int64()).getLongArray in interface StructReaderpublic List<Long> getLongList(int columnIndex)
StructReaderNULL column with type Type.array(Type.int64()).getLongList in interface StructReaderpublic List<Long> getLongList(String columnName)
StructReaderNULL column with type Type.array(Type.int64()).getLongList in interface StructReaderpublic double[] getDoubleArray(int columnIndex)
StructReaderNULL column with type Type.array(Type.float64()).getDoubleArray in interface StructReaderpublic double[] getDoubleArray(String columnName)
StructReaderNULL column with type Type.array(Type.float64()).getDoubleArray in interface StructReaderpublic List<Double> getDoubleList(int columnIndex)
StructReaderNULL column with type Type.array(Type.float64()).getDoubleList in interface StructReaderpublic List<Double> getDoubleList(String columnName)
StructReaderNULL column with type Type.array(Type.float64()).getDoubleList in interface StructReaderpublic List<String> getStringList(int columnIndex)
StructReaderNULL column with type Type.array(Type.string()).getStringList in interface StructReaderpublic List<String> getStringList(String columnName)
StructReaderNULL column with type Type.array(Type.string()).getStringList in interface StructReaderpublic List<com.google.cloud.ByteArray> getBytesList(int columnIndex)
StructReaderNULL column with type Type.array(Type.bytes()).getBytesList in interface StructReaderpublic List<com.google.cloud.ByteArray> getBytesList(String columnName)
StructReaderNULL column with type Type.array(Type.bytes()).getBytesList in interface StructReaderpublic List<com.google.cloud.Timestamp> getTimestampList(int columnIndex)
StructReaderNULL column with type Type.array(Type.timestamp()).getTimestampList in interface StructReaderpublic List<com.google.cloud.Timestamp> getTimestampList(String columnName)
StructReaderNULL column with type Type.array(Type.timestamp()).getTimestampList in interface StructReaderpublic List<com.google.cloud.Date> getDateList(int columnIndex)
StructReaderNULL column with type Type.array(Type.date()).getDateList in interface StructReaderpublic List<com.google.cloud.Date> getDateList(String columnName)
StructReaderNULL column with type Type.array(Type.date()).getDateList in interface StructReaderpublic List<Struct> getStructList(int columnIndex)
StructReaderNULL column with type Type.array(Type.struct(...)).getStructList in interface StructReaderpublic List<Struct> getStructList(String columnName)
StructReaderNULL column with type Type.array(Type.struct(...)).getStructList in interface StructReaderpublic int getColumnIndex(String columnName)
StructReadercolumnName.getColumnIndex in interface StructReaderprotected void checkNonNull(int columnIndex,
Object columnNameForError)
Copyright © 2019 Google LLC. All rights reserved.