Class GenericSqlConverter<T>

java.lang.Object
org.litebridgedb.convert.converter.GenericConverter<T>
org.litebridgedb.convert.converter.GenericSqlConverter<T>
Type Parameters:
T - the target type
All Implemented Interfaces:
Converter<T>, ConverterFunction<T>, SqlConverter<T>

public class GenericSqlConverter<T> extends GenericConverter<T> implements SqlConverter<T>
A generic implementation of SqlConverter that uses a ConverterFunction for the conversion logic.
  • Constructor Details

    • GenericSqlConverter

      public GenericSqlConverter(Class<T> type, int[] sqlTypes, ConverterFunction<T> conversionFunction)
      Constructs a new GenericSqlConverter for the specified type, SQL types, and conversion function.
      Parameters:
      type - the target Java class
      sqlTypes - an array of Types codes associated with this converter
      conversionFunction - the conversion logic
    • GenericSqlConverter

      public GenericSqlConverter(Class<T> type, int sqlType, ConverterFunction<T> conversionFunction)
      Constructs a new GenericSqlConverter for the specified type, single SQL type, and conversion function.
      Parameters:
      type - the target Java class
      sqlType - the Types code associated with this converter
      conversionFunction - the conversion logic
  • Method Details

    • sqlTypes

      public int[] sqlTypes()
      Returns an array of Types integer codes that this converter is associated with.
      Specified by:
      sqlTypes in interface SqlConverter<T>
      Returns:
      an array of SQL type codes