Class ColumnDefBuilder


  • public class ColumnDefBuilder
    extends java.lang.Object
    Builder pattern to make it easy to add column definitions to an object (e.g. table, type etc)
    • Field Detail

      • columns

        protected java.util.LinkedHashSet<ColumnDef> columns
    • Constructor Detail

      • ColumnDefBuilder

        public ColumnDefBuilder()
    • Method Detail

      • checkColumnAlreadyExists

        public void checkColumnAlreadyExists​(ColumnDef cd,
                                             java.lang.String columnName)
      • builder

        public static ColumnDefBuilder builder()
        Factory function to create a new instance of this builder
        Returns:
      • addIntColumn

        public ColumnDefBuilder addIntColumn​(java.lang.String columnName,
                                             boolean nullable)
      • addSmallIntColumn

        public ColumnDefBuilder addSmallIntColumn​(java.lang.String columnName,
                                                  java.lang.Integer defaultValue,
                                                  boolean nullable)
      • addBigIntColumn

        public ColumnDefBuilder addBigIntColumn​(java.lang.String columnName,
                                                boolean nullable)
      • addBigIntColumn

        public ColumnDefBuilder addBigIntColumn​(java.lang.String columnName,
                                                boolean nullable,
                                                java.lang.String defaultValue)
      • addDoubleColumn

        public ColumnDefBuilder addDoubleColumn​(java.lang.String columnName,
                                                boolean nullable)
      • addTimestampColumn

        public ColumnDefBuilder addTimestampColumn​(java.lang.String columnName,
                                                   boolean nullable)
      • addTimestampColumn

        public ColumnDefBuilder addTimestampColumn​(java.lang.String columnName,
                                                   boolean nullable,
                                                   java.lang.String defaultValue)
      • addVarcharColumn

        public ColumnDefBuilder addVarcharColumn​(java.lang.String columnName,
                                                 int size,
                                                 boolean nullable)
      • addCharColumn

        public ColumnDefBuilder addCharColumn​(java.lang.String columnName,
                                              int size,
                                              boolean nullable)
        Add char (fixed-width) column
        Parameters:
        columnName -
        size -
        nullable -
        Returns:
      • addCharColumn

        public ColumnDefBuilder addCharColumn​(java.lang.String columnName,
                                              int size,
                                              boolean nullable,
                                              java.lang.String defaultValue)
        Add char (fixed-width) column with a default value
        Parameters:
        columnName -
        size -
        nullable -
        Returns:
      • addBlobColumn

        public ColumnDefBuilder addBlobColumn​(java.lang.String columnName,
                                              long size,
                                              int inlineSize,
                                              boolean nullable)
      • checkColumns

        protected void checkColumns​(java.lang.String[] columns)
        Check each of the columns in the given array are valid column names
        Parameters:
        columns -
      • checkColumns

        protected void checkColumns​(java.util.Collection<java.lang.String> columns)
        Check each of the columns in the given array are valid column names
        Parameters:
        columns -
      • buildColumns

        public java.util.List<ColumnBase> buildColumns()
        Create the columns for the table based on the definitions that have been added
        Returns: