Package org.apache.kafka.connect.data
Class Timestamp
java.lang.Object
org.apache.kafka.connect.data.Timestamp
A timestamp representing an absolute time, without timezone information. The corresponding Java type is a
Date
. The underlying representation is a long representing the number of milliseconds since Unix epoch.
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic SchemaBuilder
builder()
Returns a SchemaBuilder for a Timestamp.static long
fromLogical
(Schema schema, Date value) Convert a value from its logical format (Date
) to its encoded format (long).static Date
Convert a value from its encoded format (long) to its logical format (Date
).
-
Field Details
-
LOGICAL_NAME
- See Also:
-
SCHEMA
-
-
Constructor Details
-
Timestamp
public Timestamp()
-
-
Method Details
-
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
Convert a value from its logical format (Date
) to its encoded format (long).- Parameters:
value
- the logical value- Returns:
- the encoded value
-
toLogical
Convert a value from its encoded format (long) to its logical format (Date
).- Parameters:
value
- the encoded value- Returns:
- the logical value
-