Package org.apache.kafka.connect.data
Class Time
java.lang.Object
org.apache.kafka.connect.data.Time
A time representing a specific point in a day, not tied to any specific date. The corresponding Java type is a
Date
where only hours, minutes, seconds, and milliseconds can be non-zero. This effectively makes it a
point in time during the first day after the Unix epoch. The underlying representation is an integer
representing the number of milliseconds after midnight.
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic SchemaBuilder
builder()
Returns a SchemaBuilder for a Time.static int
fromLogical
(Schema schema, Date value) Convert a value from its logical format (Date
) to its encoded format (int).static Date
Convert a value from its encoded format (int) to its logical format (Date
).
-
Field Details
-
LOGICAL_NAME
- See Also:
-
SCHEMA
-
-
Constructor Details
-
Time
public Time()
-
-
Method Details
-
builder
Returns a SchemaBuilder for a Time. 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 (int).- Parameters:
value
- the logical value- Returns:
- the encoded value
-
toLogical
Convert a value from its encoded format (int) to its logical format (Date
).- Parameters:
value
- the encoded value- Returns:
- the logical value
-