Package org.apache.kafka.connect.data
Class Timestamp
- java.lang.Object
-
- org.apache.kafka.connect.data.Timestamp
-
public class Timestamp extends Object
A timestamp representing an absolute time, without timezone information. The corresponding Java type is a java.util.Date. The underlying representation is a long representing the number of milliseconds since Unix epoch.
-
-
Field Summary
Fields Modifier and Type Field Description static String
LOGICAL_NAME
static Schema
SCHEMA
-
Constructor Summary
Constructors Constructor Description Timestamp()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static SchemaBuilder
builder()
Returns a SchemaBuilder for a Timestamp.static long
fromLogical(Schema schema, Date value)
Convert a value from its logical format (Date) to it's encoded format.static Date
toLogical(Schema schema, long value)
-
-
-
Field Detail
-
LOGICAL_NAME
public static final String LOGICAL_NAME
- See Also:
- Constant Field Values
-
SCHEMA
public static final Schema SCHEMA
-
-
Method Detail
-
builder
public static SchemaBuilder builder()
Returns a SchemaBuilder for a Timestamp. By returning a SchemaBuilder you can override additional schema settings such as required/optional, default value, and documentation.- Returns:
- a SchemaBuilder
-
fromLogical
public static long fromLogical(Schema schema, Date value)
Convert a value from its logical format (Date) to it's encoded format.- Parameters:
value
- the logical value- Returns:
- the encoded value
-
-