Class DefaultCodecs

java.lang.Object
io.r2dbc.h2.codecs.DefaultCodecs
All Implemented Interfaces:
Codecs

public final class DefaultCodecs extends Object implements Codecs
The default Codecs implementation. Delegates to type-specific codec implementations.
  • Constructor Summary

    Constructors
    Constructor
    Description
    DefaultCodecs(io.r2dbc.h2.client.Client client)
    Constructs a new DefaultCodecs (The Default Codecs list).
  • Method Summary

    Modifier and Type
    Method
    Description
    <T> T
    decode(org.h2.value.Value value, int dataType, Class<? extends T> type)
    Decode a data to a value.
    org.h2.value.Value
    encode(Object value)
    Encode a value.
    org.h2.value.Value
    encodeNull(Class<?> type)
    Encode a null value.
    preferredType(int dataType)
    Returns the preferred Java type for a given data type and format.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • DefaultCodecs

      public DefaultCodecs(io.r2dbc.h2.client.Client client)
      Constructs a new DefaultCodecs (The Default Codecs list).
      Parameters:
      client - for Lobs Codecs and whose class loader is used to search for optional Codecs.
  • Method Details

    • decode

      @Nullable public <T> T decode(org.h2.value.Value value, int dataType, Class<? extends T> type)
      Description copied from interface: Codecs
      Decode a data to a value.
      Specified by:
      decode in interface Codecs
      Type Parameters:
      T - the type of item being returned
      Parameters:
      value - the Value to decode
      dataType - the data type of the data
      type - the type to decode to
      Returns:
      the decoded value
    • encode

      public org.h2.value.Value encode(Object value)
      Description copied from interface: Codecs
      Encode a value.
      Specified by:
      encode in interface Codecs
      Parameters:
      value - the value to encode
      Returns:
      the encoded value
    • encodeNull

      public org.h2.value.Value encodeNull(Class<?> type)
      Description copied from interface: Codecs
      Encode a null value.
      Specified by:
      encodeNull in interface Codecs
      Parameters:
      type - the type to encode
      Returns:
      the encoded value
    • preferredType

      public Class<?> preferredType(int dataType)
      Description copied from interface: Codecs
      Returns the preferred Java type for a given data type and format.
      Specified by:
      preferredType in interface Codecs
      Parameters:
      dataType - the data type of the data
      Returns:
      the preferred Java type for a given data type