Module org.jooq
Package org.jooq.impl

Class AutoConverter<T,U>

All Implemented Interfaces:
Serializable, ContextConverter<T,U>, Converter<T,U>

public class AutoConverter<T,U> extends AbstractContextConverter<T,U>
A base class for automatic conversion using Configuration.converterProvider().
Author:
Lukas Eder
See Also:
  • Constructor Details

    • AutoConverter

      public AutoConverter(Class<T> fromType, Class<U> toType)
  • Method Details

    • from

      public U from(T t, ConverterContext ctx)
      Description copied from interface: ContextConverter
      Read and convert a database object to a user object.

      Implementations that don't support this conversion are expected to override Converter.fromSupported() to indicate lack of support.

      Parameters:
      t - The database object.
      ctx - The context of this conversion.
      Returns:
      The user object.
    • to

      public T to(U u, ConverterContext ctx)
      Description copied from interface: ContextConverter
      Convert and write a user object to a database object.

      Implementations that don't support this conversion are expected to override Converter.toSupported() to indicate lack of support.

      Parameters:
      u - The user object.
      ctx - The context of this conversion.
      Returns:
      The database object.
    • toString

      public String toString()
      Overrides:
      toString in class AbstractContextConverter<T,U>