java.lang.Object
org.litebridge.convert.converter.SqlTimestampConverter
- All Implemented Interfaces:
Converter<Timestamp>,ConverterFunction<Timestamp>,SqlConverter<Timestamp>
A converter for
Timestamp values.
Handles Types.TIMESTAMP.
-
Field Summary
Fields inherited from interface org.litebridge.convert.converter.Converter
DEFAULT_PRIORITY -
Constructor Summary
Constructors -
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.litebridge.convert.converter.Converter
primitiveType, priority
-
Constructor Details
-
SqlTimestampConverter
public SqlTimestampConverter()
-
-
Method Details
-
convert
Converts the given value to aTimestamp.Supports various date/time types:
ZonedDateTimeLocalDateTimeLocalDateDateNumber(treated as milliseconds since epoch)String(parsed as date/time)
- Specified by:
convertin interfaceConverterFunction<Timestamp>- Parameters:
value- the value to convert, may benull- Returns:
- the converted
Timestamp, ornull - Throws:
IllegalArgumentException- if the value type is not supported
-
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<Timestamp>- Returns:
- an array containing
Types.TIMESTAMP
-