Class AbstractStructReader

  • All Implemented Interfaces:
    StructReader
    Direct Known Subclasses:
    Struct

    public abstract class AbstractStructReader
    extends Object
    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.

    • Constructor Detail

      • AbstractStructReader

        public AbstractStructReader()
    • Method Detail

      • getBooleanInternal

        protected abstract boolean getBooleanInternal​(int columnIndex)
      • getLongInternal

        protected abstract long getLongInternal​(int columnIndex)
      • getDoubleInternal

        protected abstract double getDoubleInternal​(int columnIndex)
      • getBigDecimalInternal

        protected abstract BigDecimal getBigDecimalInternal​(int columnIndex)
      • getStringInternal

        protected abstract String getStringInternal​(int columnIndex)
      • getJsonInternal

        protected String getJsonInternal​(int columnIndex)
      • getBytesInternal

        protected abstract com.google.cloud.ByteArray getBytesInternal​(int columnIndex)
      • getTimestampInternal

        protected abstract com.google.cloud.Timestamp getTimestampInternal​(int columnIndex)
      • getDateInternal

        protected abstract com.google.cloud.Date getDateInternal​(int columnIndex)
      • getValueInternal

        protected Value getValueInternal​(int columnIndex)
      • getBooleanArrayInternal

        protected abstract boolean[] getBooleanArrayInternal​(int columnIndex)
      • getBooleanListInternal

        protected abstract List<Boolean> getBooleanListInternal​(int columnIndex)
      • getLongArrayInternal

        protected abstract long[] getLongArrayInternal​(int columnIndex)
      • getLongListInternal

        protected abstract List<Long> getLongListInternal​(int columnIndex)
      • getDoubleArrayInternal

        protected abstract double[] getDoubleArrayInternal​(int columnIndex)
      • getDoubleListInternal

        protected abstract List<Double> getDoubleListInternal​(int columnIndex)
      • getBigDecimalListInternal

        protected abstract List<BigDecimal> getBigDecimalListInternal​(int columnIndex)
      • getStringListInternal

        protected abstract List<String> getStringListInternal​(int columnIndex)
      • getJsonListInternal

        protected List<String> getJsonListInternal​(int columnIndex)
      • getBytesListInternal

        protected abstract List<com.google.cloud.ByteArray> getBytesListInternal​(int columnIndex)
      • getTimestampListInternal

        protected abstract List<com.google.cloud.Timestamp> getTimestampListInternal​(int columnIndex)
      • getDateListInternal

        protected abstract List<com.google.cloud.Date> getDateListInternal​(int columnIndex)
      • getStructListInternal

        protected abstract List<Struct> getStructListInternal​(int columnIndex)
      • getColumnCount

        public int getColumnCount()
        Description copied from interface: StructReader
        Returns the number of columns in the underlying data. This includes any columns with NULL values.
        Specified by:
        getColumnCount in interface StructReader
      • isNull

        public boolean isNull​(String columnName)
        Description copied from interface: StructReader
        Returns true if a column contains a NULL value.
        Specified by:
        isNull in interface StructReader
      • getBoolean

        public boolean getBoolean​(int columnIndex)
        Description copied from interface: StructReader
        Returns the value of a non-NULL column with type Type.bool().
        Specified by:
        getBoolean in interface StructReader
      • getBytes

        public com.google.cloud.ByteArray getBytes​(int columnIndex)
        Description copied from interface: StructReader
        Returns the value of a non-NULL column with type Type.bytes().
        Specified by:
        getBytes in interface StructReader
      • getDate

        public com.google.cloud.Date getDate​(int columnIndex)
        Description copied from interface: StructReader
        Returns the value of a non-NULL column with type Type.date().
        Specified by:
        getDate in interface StructReader
      • getBooleanArray

        public boolean[] getBooleanArray​(int columnIndex)
        Description copied from interface: StructReader
        Returns the value of a non-NULL column with type Type.array(Type.bool()).
        Specified by:
        getBooleanArray in interface StructReader
      • getBooleanArray

        public boolean[] getBooleanArray​(String columnName)
        Description copied from interface: StructReader
        Returns the value of a non-NULL column with type Type.array(Type.bool()).
        Specified by:
        getBooleanArray in interface StructReader
      • getBooleanList

        public List<Boolean> getBooleanList​(int columnIndex)
        Description copied from interface: StructReader
        Returns the value of a non-NULL column with type Type.array(Type.bool()).
        Specified by:
        getBooleanList in interface StructReader
      • getLongArray

        public long[] getLongArray​(int columnIndex)
        Description copied from interface: StructReader
        Returns the value of a non-NULL column with type Type.array(Type.int64()).
        Specified by:
        getLongArray in interface StructReader
      • getLongArray

        public long[] getLongArray​(String columnName)
        Description copied from interface: StructReader
        Returns the value of a non-NULL column with type Type.array(Type.int64()).
        Specified by:
        getLongArray in interface StructReader
      • getLongList

        public List<Long> getLongList​(int columnIndex)
        Description copied from interface: StructReader
        Returns the value of a non-NULL column with type Type.array(Type.int64()).
        Specified by:
        getLongList in interface StructReader
      • getLongList

        public List<Long> getLongList​(String columnName)
        Description copied from interface: StructReader
        Returns the value of a non-NULL column with type Type.array(Type.int64()).
        Specified by:
        getLongList in interface StructReader
      • getDoubleArray

        public double[] getDoubleArray​(int columnIndex)
        Description copied from interface: StructReader
        Returns the value of a non-NULL column with type Type.array(Type.float64()).
        Specified by:
        getDoubleArray in interface StructReader
      • getDoubleArray

        public double[] getDoubleArray​(String columnName)
        Description copied from interface: StructReader
        Returns the value of a non-NULL column with type Type.array(Type.float64()).
        Specified by:
        getDoubleArray in interface StructReader
      • getDoubleList

        public List<Double> getDoubleList​(int columnIndex)
        Description copied from interface: StructReader
        Returns the value of a non-NULL column with type Type.array(Type.float64()).
        Specified by:
        getDoubleList in interface StructReader
      • getStringList

        public List<String> getStringList​(int columnIndex)
        Description copied from interface: StructReader
        Returns the value of a non-NULL column with type Type.array(Type.string()).
        Specified by:
        getStringList in interface StructReader
      • getJsonList

        public List<String> getJsonList​(int columnIndex)
        Description copied from interface: StructReader
        Returns the value of a non-NULL column with type Type.array(Type.string()).
        Specified by:
        getJsonList in interface StructReader
      • getBytesList

        public List<com.google.cloud.ByteArray> getBytesList​(int columnIndex)
        Description copied from interface: StructReader
        Returns the value of a non-NULL column with type Type.array(Type.bytes()).
        Specified by:
        getBytesList in interface StructReader
      • getBytesList

        public List<com.google.cloud.ByteArray> getBytesList​(String columnName)
        Description copied from interface: StructReader
        Returns the value of a non-NULL column with type Type.array(Type.bytes()).
        Specified by:
        getBytesList in interface StructReader
      • getTimestampList

        public List<com.google.cloud.Timestamp> getTimestampList​(int columnIndex)
        Description copied from interface: StructReader
        Returns the value of a non-NULL column with type Type.array(Type.timestamp()).
        Specified by:
        getTimestampList in interface StructReader
      • getTimestampList

        public List<com.google.cloud.Timestamp> getTimestampList​(String columnName)
        Description copied from interface: StructReader
        Returns the value of a non-NULL column with type Type.array(Type.timestamp()).
        Specified by:
        getTimestampList in interface StructReader
      • getDateList

        public List<com.google.cloud.Date> getDateList​(int columnIndex)
        Description copied from interface: StructReader
        Returns the value of a non-NULL column with type Type.array(Type.date()).
        Specified by:
        getDateList in interface StructReader
      • getDateList

        public List<com.google.cloud.Date> getDateList​(String columnName)
        Description copied from interface: StructReader
        Returns the value of a non-NULL column with type Type.array(Type.date()).
        Specified by:
        getDateList in interface StructReader
      • getStructList

        public List<Struct> getStructList​(int columnIndex)
        Description copied from interface: StructReader
        Returns the value of a non-NULL column with type Type.array(Type.struct(...)).
        Specified by:
        getStructList in interface StructReader
      • getColumnIndex

        public int getColumnIndex​(String columnName)
        Description copied from interface: StructReader
        Returns the index of the column named columnName.
        Specified by:
        getColumnIndex in interface StructReader
      • checkNonNull

        protected void checkNonNull​(int columnIndex,
                                    Object columnNameForError)