java.lang.Object
org.litebridgedb.convert.converter.GenericConverter<T>
- Type Parameters:
T- the target type
- All Implemented Interfaces:
Converter<T>,ConverterFunction<T>
- Direct Known Subclasses:
GenericSqlConverter
A generic implementation of
Converter that uses a ConverterFunction for the conversion logic.-
Constructor Summary
ConstructorsConstructorDescriptionGenericConverter(Class<T> type, ConverterFunction<T> conversionFunction) Constructs a newGenericConverterfor the specified type and conversion function. -
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.litebridgedb.convert.converter.Converter
primitiveType
-
Constructor Details
-
GenericConverter
Constructs a newGenericConverterfor the specified type and conversion function.- Parameters:
type- the target Java classconversionFunction- the conversion logic
-
-
Method Details
-
type
Returns the target Java class this converter handles. -
convert
Converts the given value to the target type using the provided conversion function.- Specified by:
convertin interfaceConverterFunction<T>- Parameters:
value- the value to convert, may benull- Returns:
- the converted value, or
null
-