Package com.google.cloud.spanner
Class ForwardingStructReader
- java.lang.Object
-
- com.google.cloud.spanner.ForwardingStructReader
-
- All Implemented Interfaces:
StructReader
- Direct Known Subclasses:
ForwardingResultSet
public class ForwardingStructReader extends Object implements StructReader
Forwarding implements of StructReader
-
-
Constructor Summary
Constructors Constructor Description ForwardingStructReader(StructReader delegate)ForwardingStructReader(com.google.common.base.Supplier<? extends StructReader> delegate)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidcheckValidState()Called before each forwarding call to allow sub classes to do additional state checking.BigDecimalgetBigDecimal(int columnIndex)Returns the value of a non-NULLcolumn with typeType.numeric().BigDecimalgetBigDecimal(String columnName)Returns the value of a non-NULLcolumn with typeType.numeric().List<BigDecimal>getBigDecimalList(int columnIndex)Returns the value of a non-NULLcolumn with typeType.array(Type.numeric())The list returned by this method is lazily constructed.List<BigDecimal>getBigDecimalList(String columnName)Returns the value of a non-NULLcolumn with typeType.array(Type.numeric())The list returned by this method is lazily constructed.booleangetBoolean(int columnIndex)Returns the value of a non-NULLcolumn with typeType.bool().booleangetBoolean(String columnName)Returns the value of a non-NULLcolumn with typeType.bool().boolean[]getBooleanArray(int columnIndex)Returns the value of a non-NULLcolumn with typeType.array(Type.bool()).boolean[]getBooleanArray(String columnName)Returns the value of a non-NULLcolumn with typeType.array(Type.bool()).List<Boolean>getBooleanList(int columnIndex)Returns the value of a non-NULLcolumn with typeType.array(Type.bool()).List<Boolean>getBooleanList(String columnName)Returns the value of a non-NULLcolumn with typeType.array(Type.bool()).com.google.cloud.ByteArraygetBytes(int columnIndex)Returns the value of a non-NULLcolumn with typeType.bytes().com.google.cloud.ByteArraygetBytes(String columnName)Returns the value of a non-NULLcolumn with typeType.bytes().List<com.google.cloud.ByteArray>getBytesList(int columnIndex)Returns the value of a non-NULLcolumn with typeType.array(Type.bytes()).List<com.google.cloud.ByteArray>getBytesList(String columnName)Returns the value of a non-NULLcolumn with typeType.array(Type.bytes()).intgetColumnCount()Returns the number of columns in the underlying data.intgetColumnIndex(String columnName)Returns the index of the column namedcolumnName.TypegetColumnType(int columnIndex)Returns the type of a column.TypegetColumnType(String columnName)Returns the type of a column.com.google.cloud.DategetDate(int columnIndex)Returns the value of a non-NULLcolumn with typeType.date().com.google.cloud.DategetDate(String columnName)Returns the value of a non-NULLcolumn with typeType.date().List<com.google.cloud.Date>getDateList(int columnIndex)Returns the value of a non-NULLcolumn with typeType.array(Type.date()).List<com.google.cloud.Date>getDateList(String columnName)Returns the value of a non-NULLcolumn with typeType.array(Type.date()).doublegetDouble(int columnIndex)Returns the value of a non-NULLcolumn with typeType.float64().doublegetDouble(String columnName)Returns the value of a non-NULLcolumn with typeType.float64().double[]getDoubleArray(int columnIndex)Returns the value of a non-NULLcolumn with typeType.array(Type.float64()).double[]getDoubleArray(String columnName)Returns the value of a non-NULLcolumn with typeType.array(Type.float64()).List<Double>getDoubleList(int columnIndex)Returns the value of a non-NULLcolumn with typeType.array(Type.float64())The list returned by this method is lazily constructed.List<Double>getDoubleList(String columnName)Returns the value of a non-NULLcolumn with typeType.array(Type.float64())The list returned by this method is lazily constructed.StringgetJson(int columnIndex)Returns the value of a non-NULLcolumn with typeType.json().StringgetJson(String columnName)Returns the value of a non-NULLcolumn with typeType.json().List<String>getJsonList(int columnIndex)Returns the value of a non-NULLcolumn with typeType.array(Type.json()).List<String>getJsonList(String columnName)Returns the value of a non-NULLcolumn with typeType.array(Type.json()).longgetLong(int columnIndex)Returns the value of a non-NULLcolumn with typeType.int64().longgetLong(String columnName)Returns the value of a non-NULLcolumn with typeType.int64().long[]getLongArray(int columnIndex)Returns the value of a non-NULLcolumn with typeType.array(Type.int64()).long[]getLongArray(String columnName)Returns the value of a non-NULLcolumn with typeType.array(Type.int64()).List<Long>getLongList(int columnIndex)Returns the value of a non-NULLcolumn with typeType.array(Type.int64()).List<Long>getLongList(String columnName)Returns the value of a non-NULLcolumn with typeType.array(Type.int64()).StringgetPgJsonb(int columnIndex)Returns the value of a non-NULLcolumn with typeType.pgJsonb().StringgetPgJsonb(String columnName)Returns the value of a non-NULLcolumn with typeType.pgJsonb().List<String>getPgJsonbList(int columnIndex)Returns the value of a non-NULLcolumn with typeType.array(Type.pgJsonb())The list returned by this method is lazily constructed.List<String>getPgJsonbList(String columnName)Returns the value of a non-NULLcolumn with typeType.array(Type.pgJsonb())The list returned by this method is lazily constructed.StringgetString(int columnIndex)Returns the value of a non-NULLcolumn with typeType.string().StringgetString(String columnName)Returns the value of a non-NULLcolumn with typeType.string().List<String>getStringList(int columnIndex)Returns the value of a non-NULLcolumn with typeType.array(Type.string()).List<String>getStringList(String columnName)Returns the value of a non-NULLcolumn with typeType.array(Type.string()).List<Struct>getStructList(int columnIndex)Returns the value of a non-NULLcolumn with typeType.array(Type.struct(...))The list returned by this method is lazily constructed.List<Struct>getStructList(String columnName)Returns the value of a non-NULLcolumn with typeType.array(Type.struct(...))The list returned by this method is lazily constructed.com.google.cloud.TimestampgetTimestamp(int columnIndex)Returns the value of a non-NULLcolumn with typeType.timestamp().com.google.cloud.TimestampgetTimestamp(String columnName)Returns the value of a non-NULLcolumn with typeType.timestamp().List<com.google.cloud.Timestamp>getTimestampList(int columnIndex)Returns the value of a non-NULLcolumn with typeType.array(Type.timestamp())The list returned by this method is lazily constructed.List<com.google.cloud.Timestamp>getTimestampList(String columnName)Returns the value of a non-NULLcolumn with typeType.array(Type.timestamp())The list returned by this method is lazily constructed.TypegetType()Returns the type of the underlying data.ValuegetValue(int columnIndex)Returns the value of a nullable column as aValue.ValuegetValue(String columnName)Returns the value of a nullable column as aValue.booleanisNull(int columnIndex)Returnstrueif a column contains aNULLvalue.booleanisNull(String columnName)Returnstrueif a column contains aNULLvalue.
-
-
-
Constructor Detail
-
ForwardingStructReader
public ForwardingStructReader(StructReader delegate)
-
ForwardingStructReader
public ForwardingStructReader(com.google.common.base.Supplier<? extends StructReader> delegate)
-
-
Method Detail
-
checkValidState
protected void checkValidState()
Called before each forwarding call to allow sub classes to do additional state checking. Sub classes should throw anExceptionif the current state is not valid for reading data from thisForwardingStructReader. The default implementation does nothing.
-
getType
public Type getType()
Description copied from interface:StructReaderReturns the type of the underlying data. This will always be aSTRUCTtype, with fields corresponding to the data's columns. For the result of a read or query, this will always match the columns passed to theread()call or named in the query text, in order.- Specified by:
getTypein interfaceStructReader
-
getColumnCount
public int getColumnCount()
Description copied from interface:StructReaderReturns the number of columns in the underlying data. This includes any columns withNULLvalues.- Specified by:
getColumnCountin interfaceStructReader
-
getColumnIndex
public int getColumnIndex(String columnName)
Description copied from interface:StructReaderReturns the index of the column namedcolumnName.- Specified by:
getColumnIndexin interfaceStructReader
-
getColumnType
public Type getColumnType(int columnIndex)
Description copied from interface:StructReaderReturns the type of a column.- Specified by:
getColumnTypein interfaceStructReader
-
getColumnType
public Type getColumnType(String columnName)
Description copied from interface:StructReaderReturns the type of a column.- Specified by:
getColumnTypein interfaceStructReader
-
isNull
public boolean isNull(int columnIndex)
Description copied from interface:StructReaderReturnstrueif a column contains aNULLvalue.- Specified by:
isNullin interfaceStructReader
-
isNull
public boolean isNull(String columnName)
Description copied from interface:StructReaderReturnstrueif a column contains aNULLvalue.- Specified by:
isNullin interfaceStructReader
-
getBoolean
public boolean getBoolean(int columnIndex)
Description copied from interface:StructReaderReturns the value of a non-NULLcolumn with typeType.bool().- Specified by:
getBooleanin interfaceStructReader
-
getBoolean
public boolean getBoolean(String columnName)
Description copied from interface:StructReaderReturns the value of a non-NULLcolumn with typeType.bool().- Specified by:
getBooleanin interfaceStructReader
-
getLong
public long getLong(int columnIndex)
Description copied from interface:StructReaderReturns the value of a non-NULLcolumn with typeType.int64().- Specified by:
getLongin interfaceStructReader
-
getLong
public long getLong(String columnName)
Description copied from interface:StructReaderReturns the value of a non-NULLcolumn with typeType.int64().- Specified by:
getLongin interfaceStructReader
-
getDouble
public double getDouble(int columnIndex)
Description copied from interface:StructReaderReturns the value of a non-NULLcolumn with typeType.float64().- Specified by:
getDoublein interfaceStructReader
-
getDouble
public double getDouble(String columnName)
Description copied from interface:StructReaderReturns the value of a non-NULLcolumn with typeType.float64().- Specified by:
getDoublein interfaceStructReader
-
getBigDecimal
public BigDecimal getBigDecimal(int columnIndex)
Description copied from interface:StructReaderReturns the value of a non-NULLcolumn with typeType.numeric().- Specified by:
getBigDecimalin interfaceStructReader
-
getBigDecimal
public BigDecimal getBigDecimal(String columnName)
Description copied from interface:StructReaderReturns the value of a non-NULLcolumn with typeType.numeric().- Specified by:
getBigDecimalin interfaceStructReader
-
getString
public String getString(int columnIndex)
Description copied from interface:StructReaderReturns the value of a non-NULLcolumn with typeType.string().- Specified by:
getStringin interfaceStructReader
-
getString
public String getString(String columnName)
Description copied from interface:StructReaderReturns the value of a non-NULLcolumn with typeType.string().- Specified by:
getStringin interfaceStructReader
-
getJson
public String getJson(int columnIndex)
Description copied from interface:StructReaderReturns the value of a non-NULLcolumn with typeType.json().- Specified by:
getJsonin interfaceStructReader
-
getJson
public String getJson(String columnName)
Description copied from interface:StructReaderReturns the value of a non-NULLcolumn with typeType.json().- Specified by:
getJsonin interfaceStructReader
-
getPgJsonb
public String getPgJsonb(int columnIndex)
Description copied from interface:StructReaderReturns the value of a non-NULLcolumn with typeType.pgJsonb().- Specified by:
getPgJsonbin interfaceStructReader
-
getPgJsonb
public String getPgJsonb(String columnName)
Description copied from interface:StructReaderReturns the value of a non-NULLcolumn with typeType.pgJsonb().- Specified by:
getPgJsonbin interfaceStructReader
-
getBytes
public com.google.cloud.ByteArray getBytes(int columnIndex)
Description copied from interface:StructReaderReturns the value of a non-NULLcolumn with typeType.bytes().- Specified by:
getBytesin interfaceStructReader
-
getBytes
public com.google.cloud.ByteArray getBytes(String columnName)
Description copied from interface:StructReaderReturns the value of a non-NULLcolumn with typeType.bytes().- Specified by:
getBytesin interfaceStructReader
-
getTimestamp
public com.google.cloud.Timestamp getTimestamp(int columnIndex)
Description copied from interface:StructReaderReturns the value of a non-NULLcolumn with typeType.timestamp().- Specified by:
getTimestampin interfaceStructReader
-
getTimestamp
public com.google.cloud.Timestamp getTimestamp(String columnName)
Description copied from interface:StructReaderReturns the value of a non-NULLcolumn with typeType.timestamp().- Specified by:
getTimestampin interfaceStructReader
-
getDate
public com.google.cloud.Date getDate(int columnIndex)
Description copied from interface:StructReaderReturns the value of a non-NULLcolumn with typeType.date().- Specified by:
getDatein interfaceStructReader
-
getDate
public com.google.cloud.Date getDate(String columnName)
Description copied from interface:StructReaderReturns the value of a non-NULLcolumn with typeType.date().- Specified by:
getDatein interfaceStructReader
-
getBooleanArray
public boolean[] getBooleanArray(int columnIndex)
Description copied from interface:StructReaderReturns the value of a non-NULLcolumn with typeType.array(Type.bool()).- Specified by:
getBooleanArrayin interfaceStructReader
-
getBooleanArray
public boolean[] getBooleanArray(String columnName)
Description copied from interface:StructReaderReturns the value of a non-NULLcolumn with typeType.array(Type.bool()).- Specified by:
getBooleanArrayin interfaceStructReader
-
getBooleanList
public List<Boolean> getBooleanList(int columnIndex)
Description copied from interface:StructReaderReturns the value of a non-NULLcolumn with typeType.array(Type.bool()). The list returned by this method is lazily constructed. Create a copy of it if you intend to access each element in the list multiple times.- Specified by:
getBooleanListin interfaceStructReader
-
getBooleanList
public List<Boolean> getBooleanList(String columnName)
Description copied from interface:StructReaderReturns the value of a non-NULLcolumn with typeType.array(Type.bool()). The list returned by this method is lazily constructed. Create a copy of it if you intend to access each element in the list multiple times.- Specified by:
getBooleanListin interfaceStructReader
-
getLongArray
public long[] getLongArray(int columnIndex)
Description copied from interface:StructReaderReturns the value of a non-NULLcolumn with typeType.array(Type.int64()).- Specified by:
getLongArrayin interfaceStructReader
-
getLongArray
public long[] getLongArray(String columnName)
Description copied from interface:StructReaderReturns the value of a non-NULLcolumn with typeType.array(Type.int64()).- Specified by:
getLongArrayin interfaceStructReader
-
getLongList
public List<Long> getLongList(int columnIndex)
Description copied from interface:StructReaderReturns the value of a non-NULLcolumn with typeType.array(Type.int64()). The list returned by this method is lazily constructed. Create a copy of it if you intend to access each element in the list multiple times.- Specified by:
getLongListin interfaceStructReader
-
getLongList
public List<Long> getLongList(String columnName)
Description copied from interface:StructReaderReturns the value of a non-NULLcolumn with typeType.array(Type.int64()). The list returned by this method is lazily constructed. Create a copy of it if you intend to access each element in the list multiple times.- Specified by:
getLongListin interfaceStructReader
-
getDoubleArray
public double[] getDoubleArray(int columnIndex)
Description copied from interface:StructReaderReturns the value of a non-NULLcolumn with typeType.array(Type.float64()).- Specified by:
getDoubleArrayin interfaceStructReader
-
getDoubleArray
public double[] getDoubleArray(String columnName)
Description copied from interface:StructReaderReturns the value of a non-NULLcolumn with typeType.array(Type.float64()).- Specified by:
getDoubleArrayin interfaceStructReader
-
getDoubleList
public List<Double> getDoubleList(int columnIndex)
Description copied from interface:StructReaderReturns the value of a non-NULLcolumn with typeType.array(Type.float64())The list returned by this method is lazily constructed. Create a copy of it if you intend to access each element in the list multiple times.- Specified by:
getDoubleListin interfaceStructReader
-
getDoubleList
public List<Double> getDoubleList(String columnName)
Description copied from interface:StructReaderReturns the value of a non-NULLcolumn with typeType.array(Type.float64())The list returned by this method is lazily constructed. Create a copy of it if you intend to access each element in the list multiple times.- Specified by:
getDoubleListin interfaceStructReader
-
getBigDecimalList
public List<BigDecimal> getBigDecimalList(int columnIndex)
Description copied from interface:StructReaderReturns the value of a non-NULLcolumn with typeType.array(Type.numeric())The list returned by this method is lazily constructed. Create a copy of it if you intend to access each element in the list multiple times.- Specified by:
getBigDecimalListin interfaceStructReader
-
getBigDecimalList
public List<BigDecimal> getBigDecimalList(String columnName)
Description copied from interface:StructReaderReturns the value of a non-NULLcolumn with typeType.array(Type.numeric())The list returned by this method is lazily constructed. Create a copy of it if you intend to access each element in the list multiple times.- Specified by:
getBigDecimalListin interfaceStructReader
-
getStringList
public List<String> getStringList(int columnIndex)
Description copied from interface:StructReaderReturns the value of a non-NULLcolumn with typeType.array(Type.string()). The list returned by this method is lazily constructed. Create a copy of it if you intend to access each element in the list multiple times.- Specified by:
getStringListin interfaceStructReader
-
getStringList
public List<String> getStringList(String columnName)
Description copied from interface:StructReaderReturns the value of a non-NULLcolumn with typeType.array(Type.string()). The list returned by this method is lazily constructed. Create a copy of it if you intend to access each element in the list multiple times.- Specified by:
getStringListin interfaceStructReader
-
getJsonList
public List<String> getJsonList(int columnIndex)
Description copied from interface:StructReaderReturns the value of a non-NULLcolumn with typeType.array(Type.json()). The list returned by this method is lazily constructed. Create a copy of it if you intend to access each element in the list multiple times.- Specified by:
getJsonListin interfaceStructReader
-
getJsonList
public List<String> getJsonList(String columnName)
Description copied from interface:StructReaderReturns the value of a non-NULLcolumn with typeType.array(Type.json()). The list returned by this method is lazily constructed. Create a copy of it if you intend to access each element in the list multiple times.- Specified by:
getJsonListin interfaceStructReader
-
getPgJsonbList
public List<String> getPgJsonbList(int columnIndex)
Description copied from interface:StructReaderReturns the value of a non-NULLcolumn with typeType.array(Type.pgJsonb())The list returned by this method is lazily constructed. Create a copy of it if you intend to access each element in the list multiple times.- Specified by:
getPgJsonbListin interfaceStructReader
-
getPgJsonbList
public List<String> getPgJsonbList(String columnName)
Description copied from interface:StructReaderReturns the value of a non-NULLcolumn with typeType.array(Type.pgJsonb())The list returned by this method is lazily constructed. Create a copy of it if you intend to access each element in the list multiple times.- Specified by:
getPgJsonbListin interfaceStructReader
-
getBytesList
public List<com.google.cloud.ByteArray> getBytesList(int columnIndex)
Description copied from interface:StructReaderReturns the value of a non-NULLcolumn with typeType.array(Type.bytes()). The list returned by this method is lazily constructed. Create a copy of it if you intend to access each element in the list multiple times.- Specified by:
getBytesListin interfaceStructReader
-
getBytesList
public List<com.google.cloud.ByteArray> getBytesList(String columnName)
Description copied from interface:StructReaderReturns the value of a non-NULLcolumn with typeType.array(Type.bytes()). The list returned by this method is lazily constructed. Create a copy of it if you intend to access each element in the list multiple times.- Specified by:
getBytesListin interfaceStructReader
-
getTimestampList
public List<com.google.cloud.Timestamp> getTimestampList(int columnIndex)
Description copied from interface:StructReaderReturns the value of a non-NULLcolumn with typeType.array(Type.timestamp())The list returned by this method is lazily constructed. Create a copy of it if you intend to access each element in the list multiple times.- Specified by:
getTimestampListin interfaceStructReader
-
getTimestampList
public List<com.google.cloud.Timestamp> getTimestampList(String columnName)
Description copied from interface:StructReaderReturns the value of a non-NULLcolumn with typeType.array(Type.timestamp())The list returned by this method is lazily constructed. Create a copy of it if you intend to access each element in the list multiple times.- Specified by:
getTimestampListin interfaceStructReader
-
getDateList
public List<com.google.cloud.Date> getDateList(int columnIndex)
Description copied from interface:StructReaderReturns the value of a non-NULLcolumn with typeType.array(Type.date()). The list returned by this method is lazily constructed. Create a copy of it if you intend to access each element in the list multiple times.- Specified by:
getDateListin interfaceStructReader
-
getDateList
public List<com.google.cloud.Date> getDateList(String columnName)
Description copied from interface:StructReaderReturns the value of a non-NULLcolumn with typeType.array(Type.date()). The list returned by this method is lazily constructed. Create a copy of it if you intend to access each element in the list multiple times.- Specified by:
getDateListin interfaceStructReader
-
getStructList
public List<Struct> getStructList(int columnIndex)
Description copied from interface:StructReaderReturns the value of a non-NULLcolumn with typeType.array(Type.struct(...))The list returned by this method is lazily constructed. Create a copy of it if you intend to access each element in the list multiple times.- Specified by:
getStructListin interfaceStructReader
-
getStructList
public List<Struct> getStructList(String columnName)
Description copied from interface:StructReaderReturns the value of a non-NULLcolumn with typeType.array(Type.struct(...))The list returned by this method is lazily constructed. Create a copy of it if you intend to access each element in the list multiple times.- Specified by:
getStructListin interfaceStructReader
-
getValue
public Value getValue(int columnIndex)
Description copied from interface:StructReaderReturns the value of a nullable column as aValue.- Specified by:
getValuein interfaceStructReader
-
getValue
public Value getValue(String columnName)
Description copied from interface:StructReaderReturns the value of a nullable column as aValue.- Specified by:
getValuein interfaceStructReader
-
-