Package io.debezium.time
Class Interval
- java.lang.Object
-
- io.debezium.time.Interval
-
public class Interval extends Object
A utility representing a duration into a string value formatted using ISO string format.- Author:
- Jiri Pechanec (jpechane@redhat.com)
-
-
Field Summary
Fields Modifier and Type Field Description static StringSCHEMA_NAME
-
Constructor Summary
Constructors Modifier Constructor Description privateInterval()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static org.apache.kafka.connect.data.SchemaBuilderbuilder()Returns aSchemaBuilderfor aInterval.static org.apache.kafka.connect.data.Schemaschema()Returns a Schema for aIntervalbut with all other default Schema settings.static StringtoIsoString(int years, int months, int days, int hours, int minutes, BigDecimal seconds)Converts a number of time units to a ISO formatted string.
-
-
-
Field Detail
-
SCHEMA_NAME
public static final String SCHEMA_NAME
- See Also:
- Constant Field Values
-
-
Method Detail
-
builder
public static org.apache.kafka.connect.data.SchemaBuilder builder()
Returns aSchemaBuilderfor aInterval. The resulting schema will describe a field with the "io.debezium.time.Interval" as thenameand {@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 aIntervalbut with all other default Schema settings. The schema describes a field with the "io.debezium.time.Interval" as thenameandSchemaBuilder.string()STRING} for the literal type storing the components of the interval.- Returns:
- the schema
- See Also:
builder()
-
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.MONTHSis used.- Returns:
-
-