Class DataTypeBuilder

java.lang.Object
io.debezium.relational.ddl.DataTypeBuilder

public class DataTypeBuilder extends Object
Author:
Roman Kuchár <[email protected]>.
  • Field Details

    • prefix

      private StringBuilder prefix
    • suffix

      private StringBuilder suffix
    • parameters

      private String parameters
    • jdbcType

      private int jdbcType
    • length

      private long length
    • scale

      private int scale
    • arrayDimsLength

      private int arrayDimsLength
    • arrayDims

      private final int[] arrayDims
    • SIGNED_UNSIGNED_ZEROFILL_PATTERN

      private static final Pattern SIGNED_UNSIGNED_ZEROFILL_PATTERN
  • Constructor Details

    • DataTypeBuilder

      public DataTypeBuilder()
  • Method Details

    • addToName

      public void addToName(String str)
    • jdbcType

      public DataTypeBuilder jdbcType(int jdbcType)
    • parameters

      public DataTypeBuilder parameters(String parameters)
    • length

      public DataTypeBuilder length(long length)
    • scale

      public DataTypeBuilder scale(int scale)
    • addArrayDimension

      public DataTypeBuilder addArrayDimension(int dimension)
    • reset

      public DataTypeBuilder reset()
    • create

      public DataType create()
    • adjustSignedUnsignedZerofill

      private String adjustSignedUnsignedZerofill(StringBuilder origin)
      This method will adjust the suffix names of numeric data type. In connector streaming phase, the ddl parser maybe meet the invalid definition of suffix names with numeric data type, will adjust to appropriate values. e.g. replace "SIGNED UNSIGNED ZEROFILL" or "SIGNED ZEROFILL" to "UNSIGNED ZEROFILL", "SIGNED UNSIGNED" to "UNSIGNED" and adjust to "UNSIGNED ZEROFILL" if "zerofill" appears alone.