Package io.debezium.time
Class Interval
java.lang.Object
io.debezium.time.Interval
A utility representing a duration into a string value formatted using ISO string format.
- Author:
- Jiri Pechanec ([email protected])
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic org.apache.kafka.connect.data.SchemaBuilder
builder()
Returns aSchemaBuilder
for aInterval
.static org.apache.kafka.connect.data.Schema
schema()
Returns a Schema for aInterval
but with all other default Schema settings.static String
toIsoString
(int years, int months, int days, int hours, int minutes, BigDecimal seconds) Converts a number of time units to a ISO formatted string.
-
Field Details
-
SCHEMA_NAME
- See Also:
-
-
Constructor Details
-
Interval
private Interval()
-
-
Method Details
-
builder
public static org.apache.kafka.connect.data.SchemaBuilder builder()Returns aSchemaBuilder
for aInterval
. The resulting schema will describe a field with the "io.debezium.time.Interval" as thename
and {@link SchemaBuilder#string()()} STRING} for the literal type storing the components of the interval.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 aInterval
but with all other default Schema settings. The schema describes a field with the "io.debezium.time.Interval" as thename
andSchemaBuilder.string()
STRING} for the literal type storing the components of the interval.- Returns:
- the schema
- See Also:
-
toIsoString
public static String toIsoString(int years, int months, int days, int hours, int minutes, BigDecimal seconds) Converts a number of time units to a ISO formatted string.- Parameters:
years
- a number of yearsmonths
- a number of monthsdays
- a number of dayshours
- a number of hoursminutes
- a number of minutesseconds
- a number of secondsmicros
- a number of microsecondsdaysPerMonthAvg
- an optional value representing a days per month average; if null, the default duration fromChronoUnit.MONTHS
is used.- Returns:
-