private Object maybeConvertLogicalType(final Schema connectSchema, final Object connectValue) { if (connectSchema.name() == null) { return connectValue; } switch (connectSchema.name()) { case Date.LOGICAL_NAME: return Date.fromLogical(connectSchema, (java.util.Date) connectValue); case Time.LOGICAL_NAME: return Time.fromLogical(connectSchema, (java.util.Date) connectValue); case Timestamp.LOGICAL_NAME: return Timestamp.fromLogical(connectSchema, (java.util.Date) connectValue); default: return connectValue; } }
@Override public Headers addTime(String key, java.util.Date value) { if (value != null) { // Check that this is a time ... Time.fromLogical(Time.SCHEMA, value); } return addWithoutValidating(key, value, Time.SCHEMA); }
return Time.fromLogical(fromSchema, (java.util.Date) value);
long millis = Time.fromLogical(fromSchema, date); return Timestamp.toLogical(toSchema, millis);