Class ArrayAdapter<T>

Type Parameters:
T - Java type to represent the entire array.
All Implemented Interfaces:
Adapter.ArrayProto<T[]>, SlotTester.Visible

public class ArrayAdapter<T> extends Adapter.Array<T>
Ancestor of adapters that can map a PostgreSQL array to some representation <T>.
  • Field Details

    • FLAT_STRING_LIST_INSTANCE

      public static final ArrayAdapter<List<String>> FLAT_STRING_LIST_INSTANCE
      An ArrayAdapter that maps any PostgreSQL array with element type compatible with TextAdapter to flat (disregarding the PostgreSQL array's dimensionality) List of String, with any null elements mapped to Java null.
  • Constructor Details

  • Method Details

    • canFetch

      public boolean canFetch(RegType pgType)
      Whether this adapter can be applied to the given PostgreSQL type.

      If not overridden, simply requires that pgType is an array type and that its declared element type is acceptable to canFetch of the configured element adapter.

      Overrides:
      canFetch in class Adapter<T,Void>
    • fetch

      public T fetch(Attribute a, Datum.Input in) throws SQLException, IOException
      Returns the result of applying the configured element adapter and array contract to the contents of the array in.
      Throws:
      SQLException
      IOException