Class DateTimeCoercion
java.lang.Object
io.github.connellite.util.internal.DateTimeCoercion
Date and time coercion used by
TypeCoercionUtil.-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
DateTimeCoercion
public DateTimeCoercion()
-
-
Method Details
-
supports
Returns whethertargetTypeis a date or time type handled here.- Parameters:
targetType- desired type, nevernull- Returns:
truefor JDBC,Date, andjava.timedate/time targets
-
coerce
Coercesrawtoward a date or timetargetType.supports(Class)istruefortargetType. An incompatible value yieldsnull. A non-blank string that is not a date or time throws.- Type Parameters:
T- target type- Parameters:
raw- source value, nevernulltargetType- date or time type to coerce toward- Returns:
- coerced value, or
nullwhenrawdoes not matchtargetType - Throws:
TypeCoercionException- when a non-blank string is not a date or time
-