java.lang.Object
org.postgresql.pljava.Adapter<T,Void>
org.postgresql.pljava.Adapter.As<T,Void>
org.postgresql.pljava.Adapter.Array<T>
org.postgresql.pljava.pg.adt.ArrayAdapter<T>
- Type Parameters:
T
- Java type to represent the entire array.
- All Implemented Interfaces:
Adapter.ArrayProto<T[]>
,SlotTester.Visible
Ancestor of adapters that can map a PostgreSQL array to some representation
<T>.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.postgresql.pljava.Adapter
Adapter.AdapterException, Adapter.Array<T>, Adapter.ArrayBuilder<TA,
TI>, Adapter.ArrayProto<TA>, Adapter.As<T, U>, Adapter.AsBoolean<U>, Adapter.AsByte<U>, Adapter.AsChar<U>, Adapter.AsDouble<U>, Adapter.AsFloat<U>, Adapter.AsInt<U>, Adapter.AsLong<U>, Adapter.AsShort<U>, Adapter.Configuration, Adapter.Container, Adapter.Contract<T>, Adapter.Dispenser<T, U extends Adapter.Contract<T>>, Adapter.Permission, Adapter.Primitive<T, U, TA>, Adapter.PullDispenser<T, U extends Adapter.Contract<T>>, Adapter.Service, Adapter.TypeWrapper, Adapter.Via -
Field Summary
Modifier and TypeFieldDescriptionstatic final ArrayAdapter
<List<String>> AnArrayAdapter
that maps any PostgreSQL array with element type compatible withTextAdapter
to flat (disregarding the PostgreSQL array's dimensionality)List
ofString
, with any null elements mapped to Java null.Fields inherited from class org.postgresql.pljava.Adapter.Array
m_contract, m_elementAdapter
-
Constructor Summary
ConstructorDescriptionArrayAdapter
(Adapter.As<E, ?> element, Adapter.Contract.Array<T, E, Adapter.As<E, ?>> contract) Constructs an array adapter given an adapter that returns a reference type <E> for the element type, and a corresponding array contract producing <T>.ArrayAdapter
(Adapter.AsBoolean<?> element, Adapter.Contract.Array<T, Boolean, Adapter.AsBoolean<?>> contract) Constructs an array adapter given an adapter that returns a primitiveboolean
for the element type, and a corresponding array contract producing <T>.ArrayAdapter
(Adapter.AsByte<?> element, Adapter.Contract.Array<T, Byte, Adapter.AsByte<?>> contract) Constructs an array adapter given an adapter that returns a primitivebyte
for the element type, and a corresponding array contract producing <T>.ArrayAdapter
(Adapter.AsChar<?> element, Adapter.Contract.Array<T, Character, Adapter.AsChar<?>> contract) Constructs an array adapter given an adapter that returns a primitivechar
for the element type, and a corresponding array contract producing <T>.ArrayAdapter
(Adapter.AsDouble<?> element, Adapter.Contract.Array<T, Double, Adapter.AsDouble<?>> contract) Constructs an array adapter given an adapter that returns a primitivedouble
for the element type, and a corresponding array contract producing <T>.ArrayAdapter
(Adapter.AsFloat<?> element, Adapter.Contract.Array<T, Float, Adapter.AsFloat<?>> contract) Constructs an array adapter given an adapter that returns a primitivefloat
for the element type, and a corresponding array contract producing <T>.ArrayAdapter
(Adapter.AsInt<?> element, Adapter.Contract.Array<T, Integer, Adapter.AsInt<?>> contract) Constructs an array adapter given an adapter that returns a primitiveint
for the element type, and a corresponding array contract producing <T>.ArrayAdapter
(Adapter.AsLong<?> element, Adapter.Contract.Array<T, Long, Adapter.AsLong<?>> contract) Constructs an array adapter given an adapter that returns a primitivelong
for the element type, and a corresponding array contract producing <T>.ArrayAdapter
(Adapter.AsShort<?> element, Adapter.Contract.Array<T, Short, Adapter.AsShort<?>> contract) Constructs an array adapter given an adapter that returns a primitiveshort
for the element type, and a corresponding array contract producing <T>. -
Method Summary
Modifier and TypeMethodDescriptionboolean
Whether this adapter can be applied to the given PostgreSQL type.fetch
(Attribute a, Datum.Input in) Returns the result of applying the configured element adapter andarray contract
to the contents of the array in.Methods inherited from class org.postgresql.pljava.Adapter.As
arrayOf, canFetchNull, fetch, fetchNull
Methods inherited from class org.postgresql.pljava.Adapter
canFetch, configure, topType, topType, toString, underType
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.postgresql.pljava.Adapter.ArrayProto
a1, a2, a4
-
Field Details
-
FLAT_STRING_LIST_INSTANCE
AnArrayAdapter
that maps any PostgreSQL array with element type compatible withTextAdapter
to flat (disregarding the PostgreSQL array's dimensionality)List
ofString
, with any null elements mapped to Java null.
-
-
Constructor Details
-
ArrayAdapter
Constructs an array adapter given an adapter that returns a reference type <E> for the element type, and a corresponding array contract producing <T>. -
ArrayAdapter
public ArrayAdapter(Adapter.AsLong<?> element, Adapter.Contract.Array<T, Long, Adapter.AsLong<?>> contract) Constructs an array adapter given an adapter that returns a primitivelong
for the element type, and a corresponding array contract producing <T>. -
ArrayAdapter
public ArrayAdapter(Adapter.AsDouble<?> element, Adapter.Contract.Array<T, Double, Adapter.AsDouble<?>> contract) Constructs an array adapter given an adapter that returns a primitivedouble
for the element type, and a corresponding array contract producing <T>. -
ArrayAdapter
public ArrayAdapter(Adapter.AsInt<?> element, Adapter.Contract.Array<T, Integer, Adapter.AsInt<?>> contract) Constructs an array adapter given an adapter that returns a primitiveint
for the element type, and a corresponding array contract producing <T>. -
ArrayAdapter
public ArrayAdapter(Adapter.AsFloat<?> element, Adapter.Contract.Array<T, Float, Adapter.AsFloat<?>> contract) Constructs an array adapter given an adapter that returns a primitivefloat
for the element type, and a corresponding array contract producing <T>. -
ArrayAdapter
public ArrayAdapter(Adapter.AsShort<?> element, Adapter.Contract.Array<T, Short, Adapter.AsShort<?>> contract) Constructs an array adapter given an adapter that returns a primitiveshort
for the element type, and a corresponding array contract producing <T>. -
ArrayAdapter
public ArrayAdapter(Adapter.AsChar<?> element, Adapter.Contract.Array<T, Character, Adapter.AsChar<?>> contract) Constructs an array adapter given an adapter that returns a primitivechar
for the element type, and a corresponding array contract producing <T>. -
ArrayAdapter
public ArrayAdapter(Adapter.AsByte<?> element, Adapter.Contract.Array<T, Byte, Adapter.AsByte<?>> contract) Constructs an array adapter given an adapter that returns a primitivebyte
for the element type, and a corresponding array contract producing <T>. -
ArrayAdapter
public ArrayAdapter(Adapter.AsBoolean<?> element, Adapter.Contract.Array<T, Boolean, Adapter.AsBoolean<?>> contract) Constructs an array adapter given an adapter that returns a primitiveboolean
for the element type, and a corresponding array contract producing <T>.
-
-
Method Details
-
canFetch
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. -
fetch
Returns the result of applying the configured element adapter andarray contract
to the contents of the array in.- Throws:
SQLException
IOException
-