Class VectorFloatCodec

java.lang.Object
io.r2dbc.postgresql.codec.VectorFloatCodec
All Implemented Interfaces:
Codec<float[]>, CodecMetadata

public class VectorFloatCodec extends Object implements Codec<float[]>, CodecMetadata
  • Method Details

    • encodeNull

      public io.r2dbc.postgresql.client.EncodedParameter encodeNull()
      Description copied from interface: Codec
      Encode a null value.
      Specified by:
      encodeNull in interface Codec<float[]>
      Returns:
      the encoded null value
    • type

      public Class<?> type()
      Description copied from interface: CodecMetadata
      Returns the Java type of this codec.
      Specified by:
      type in interface CodecMetadata
      Returns:
      the Java type
    • getDataTypes

      public Iterable<? extends PostgresTypeIdentifier> getDataTypes()
      Description copied from interface: CodecMetadata
      Returns the collection of PostgresTypeIdentifier this codec can handle
      Specified by:
      getDataTypes in interface CodecMetadata
      Returns:
      the datatypes
    • canDecode

      public boolean canDecode(int dataType, io.r2dbc.postgresql.message.Format format, Class<?> type)
      Description copied from interface: Codec
      Determine whether this Codec is capable of decoding a value for the given dataType and Format and whether it can represent the decoded value as the desired type.
      Specified by:
      canDecode in interface Codec<float[]>
      Parameters:
      dataType - the Postgres OID to decode
      format - the data type Format, text or binary
      type - the desired value type
      Returns:
      true if this codec is able to decode values for tge given dataType and Format
    • canEncode

      public boolean canEncode(Object value)
      Description copied from interface: Codec
      Determine whether this Codec is capable of encoding the value.
      Specified by:
      canEncode in interface Codec<float[]>
      Parameters:
      value - the parameter value
      Returns:
      true if this Codec is able to encode the value.
      See Also:
    • canEncodeNull

      public boolean canEncodeNull(Class<?> type)
      Description copied from interface: Codec
      Determine whether this Codec is capable of encoding a null value for the given Class type.
      Specified by:
      canEncodeNull in interface Codec<float[]>
      Parameters:
      type - the desired value type
      Returns:
      true if this Codec is able to encode null values for the given Class type.
      See Also:
    • decode

      public float[] decode(@Nullable io.netty.buffer.ByteBuf buffer, int dataType, io.r2dbc.postgresql.message.Format format, Class<? extends float[]> type)
      Description copied from interface: Codec
      Decode the buffer and return it as the requested type.
      Specified by:
      decode in interface Codec<float[]>
      Parameters:
      buffer - the data buffer
      dataType - the Postgres OID to encode
      format - the data type Format, text or binary
      type - the desired value type
      Returns:
      the decoded value. Can be null if the value is null.
    • encode

      public io.r2dbc.postgresql.client.EncodedParameter encode(Object value)
      Description copied from interface: Codec
      Encode the value to be used as RPC parameter.
      Specified by:
      encode in interface Codec<float[]>
      Parameters:
      value - the value
      Returns:
      the encoded value
    • encode

      public io.r2dbc.postgresql.client.EncodedParameter encode(Object value, int dataType)
      Description copied from interface: Codec
      Encode the value to be used as RPC parameter.
      Specified by:
      encode in interface Codec<float[]>
      Parameters:
      value - the value
      dataType - the Postgres OID to encode
      Returns:
      the encoded value