java.lang.Object
org.postgresql.pljava.Adapter<T,U>
org.postgresql.pljava.Adapter.Primitive<T,U,TA>
- All Implemented Interfaces:
Adapter.ArrayProto<TA>
,SlotTester.Visible
- Direct Known Subclasses:
Adapter.AsBoolean
,Adapter.AsByte
,Adapter.AsChar
,Adapter.AsDouble
,Adapter.AsFloat
,Adapter.AsInt
,Adapter.AsLong
,Adapter.AsShort
public abstract static class Adapter.Primitive<T,U,TA>
extends Adapter<T,U>
implements Adapter.ArrayProto<TA>
Ancestor class for adapters that fetch something and return it as
a Java primitive type.
Subclasses for integral types, namely AsLong
, asInt
,
and AsShort
, cannot be extended directly, but only via their
Signed
or Unsigned
nested subclasses, according to how
the value is meant to be used. Nothing can change how Java treats the
primitive types (always as signed), but the Signed
and
Unsigned
subclasses here offer methods for the operations that
differ, allowing the right behavior to be achieved if those methods
are used.
Whether an adapter extends AsShort.Unsigned
or AsChar
(also an unsigned 16-bit type) should be determined based on whether
the resulting value is meant to have a UTF-16 character meaning.
-
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.Via -
Method Summary
Modifier and TypeMethodDescriptionboolean
Implementation ofcanFetchNull
that unconditionally returns false, as primitive adapters have no reliably distinguishable values to which SQL null can be mapped.Methods inherited from class org.postgresql.pljava.Adapter
canFetch, 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
-
Method Details
-
canFetchNull
public boolean canFetchNull()Implementation ofcanFetchNull
that unconditionally returns false, as primitive adapters have no reliably distinguishable values to which SQL null can be mapped.- Specified by:
canFetchNull
in classAdapter<T,
U>
-