Package org.apache.kafka.connect.data
Class Date
java.lang.Object
org.apache.kafka.connect.data.Date
A date representing a calendar day with no time of day or timezone. The corresponding Java type is a Date
with hours, minutes, seconds, milliseconds set to 0. The underlying representation is an integer representing the
number of standardized days (based on a number of milliseconds with 24 hours/day, 60 minutes/hour, 60 seconds/minute,
1000 milliseconds/second with n) since Unix epoch.
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic SchemaBuilder
builder()
Returns a SchemaBuilder for a Date.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
-
Date
public Date()
-
-
Method Details
-
builder
Returns a SchemaBuilder for a Date. 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
-