Package io.debezium.time
Class Time
java.lang.Object
io.debezium.time.Time
A utility for converting various Java time representations into the
INT32 number of
milliseconds since midnight, and for defining a Kafka Connect Schema for time values with no date or timezone
information.-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic org.apache.kafka.connect.data.SchemaBuilderbuilder()Returns aSchemaBuilderfor aTime.static org.apache.kafka.connect.data.Schemaschema()Returns a Schema for aTimebut with all other default Schema settings.static inttoMilliOfDay(Object value, boolean acceptLargeValues) Get the number of milliseconds past midnight of the givenDuration.
-
Field Details
-
SCHEMA_NAME
- See Also:
-
ONE_DAY
-
-
Constructor Details
-
Time
private Time()
-
-
Method Details
-
builder
public static org.apache.kafka.connect.data.SchemaBuilder builder()Returns aSchemaBuilderfor aTime. The resulting schema will describe a field with the "io.debezium.time.Time" as thenameandINT32for the literal type storing the number of milliseconds past midnight.You can use the resulting SchemaBuilder to set or override additional schema settings such as required/optional, default value, and documentation.
- Returns:
- the schema builder
-
schema
public static org.apache.kafka.connect.data.Schema schema()Returns a Schema for aTimebut with all other default Schema settings. The schema describes a field with the "io.debezium.time.Time" as thenameandINT32for the literal type storing the number of milliseconds past midnight.- Returns:
- the schema
- See Also:
-
toMilliOfDay
Get the number of milliseconds past midnight of the givenDuration.- Parameters:
value- the duration value; may not be nullacceptLargeValues- whether to accept values less than 00:00:00 and larger than 24:00:00 or not- Returns:
- the milliseconds past midnight
- Throws:
IllegalArgumentException- if the value is not an instance of the acceptable types or it is out of the supported range
-