java.lang.Object
org.litebridgedb.convert.converter.StringConverter
- All Implemented Interfaces:
Converter<String>,ConverterFunction<String>,SqlConverter<String>
A converter for
String values.
Handles Types.CHAR, Types.VARCHAR, and Types.LONGVARCHAR.
-
Constructor Details
-
StringConverter
public StringConverter()
-
-
Method Details
-
convert
Converts the given value to aString.If the value is a
byte[]orchar[], it is converted to a string using the appropriate constructor. Otherwise,Object.toString()is used.- Specified by:
convertin interfaceConverterFunction<String>- Parameters:
value- the value to convert, may benull- Returns:
- the converted string, or
null
-
type
Returns the target Java class this converter handles. -
sqlTypes
public int[] sqlTypes()Returns the SQL types associated with this converter.- Specified by:
sqlTypesin interfaceSqlConverter<String>- Returns:
- an array containing
Types.CHAR,Types.VARCHAR, andTypes.LONGVARCHAR
-