Interface Bitstring.Bit<T>

All Superinterfaces:
Adapter.Contract<T>, Adapter.Contract.Scalar<T>
Enclosing interface:
Bitstring
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public static interface Bitstring.Bit<T> extends Adapter.Contract.Scalar<T>
The BIT and VARBIT types' PostgreSQL semantics: the number of bits, and the sequence of bytes they're packed into.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Interface
    Description
    static interface 
    Functional interface to obtain information from the PostgreSQL type modifier applied to the type.

    Nested classes/interfaces inherited from interface org.postgresql.pljava.Adapter.Contract

    Adapter.Contract.Array<T,E,A extends Adapter<E,?>>, Adapter.Contract.Scalar<T>
  • Method Summary

    Modifier and Type
    Method
    Description
    construct(int nBits, ByteBuffer bytes)
    Constructs a representation T from the components of the PostgreSQL data type.
  • Method Details

    • construct

      T construct(int nBits, ByteBuffer bytes)
      Constructs a representation T from the components of the PostgreSQL data type.
      Parameters:
      nBits - the actual number of bits in the value, not necessarily a multiple of 8. For type BIT, must equal the modifier nBits if specified; for VARBIT, must be equal or smaller.
      bytes - a buffer of ceiling(nBits/8) bytes, not aliasing any internal storage, so safely readable (and writable, if useful for format conversion). Before accessing it in wider units, its byte order should be explicitly set. Within each byte, the logical order of the bits is from MSB to LSB; beware that this within-byte bit order is the reverse of what java.util.BitSet.valueOf(...) expects. When nBits is not a multiple of 8, the unused low-order bits of the final byte must be zero.