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 ([email protected])
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
     
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    private
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static org.apache.kafka.connect.data.SchemaBuilder
    Returns a SchemaBuilder for a Interval.
    static org.apache.kafka.connect.data.Schema
    Returns a Schema for a Interval 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.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Constructor Details

    • Interval

      private Interval()
  • Method Details

    • builder

      public static org.apache.kafka.connect.data.SchemaBuilder builder()
      Returns a SchemaBuilder for a Interval. The resulting schema will describe a field with the "io.debezium.time.Interval" as the name 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 a Interval but with all other default Schema settings. The schema describes a field with the "io.debezium.time.Interval" as the name and SchemaBuilder.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 years
      months - a number of months
      days - a number of days
      hours - a number of hours
      minutes - a number of minutes
      seconds - a number of seconds
      micros - a number of microseconds
      daysPerMonthAvg - an optional value representing a days per month average; if null, the default duration from ChronoUnit.MONTHS is used.
      Returns: