Class ColumnDTO.Builder<S extends ColumnDTO.Builder>

java.lang.Object
org.apache.gravitino.dto.rel.ColumnDTO.Builder<S>
Type Parameters:
S - The type of the builder subclass.
Enclosing class:
ColumnDTO

public static class ColumnDTO.Builder<S extends ColumnDTO.Builder> extends Object
Builder class for constructing ColumnDTO instances.
  • Field Details

    • name

      protected String name
      The name of the column.
    • dataType

      protected Type dataType
      The data type of the column.
    • comment

      protected String comment
      The comment associated with the column.
    • nullable

      protected boolean nullable
      Whether the column value can be null.
    • autoIncrement

      protected boolean autoIncrement
      Whether the column is an auto-increment column.
    • defaultValue

      protected Expression defaultValue
      The default value of the column.
  • Constructor Details

    • Builder

      public Builder()
      Constructs a new Builder.
  • Method Details

    • withName

      public S withName(String name)
      Sets the name of the column.
      Parameters:
      name - The name of the column.
      Returns:
      The Builder instance.
    • withDataType

      public S withDataType(Type dataType)
      Sets the data type of the column.
      Parameters:
      dataType - The data type of the column.
      Returns:
      The Builder instance.
    • withComment

      public S withComment(String comment)
      Sets the comment associated with the column.
      Parameters:
      comment - The comment associated with the column.
      Returns:
      The Builder instance.
    • withNullable

      public S withNullable(boolean nullable)
      Sets whether the column value can be null.
      Parameters:
      nullable - Whether the column value can be null.
      Returns:
      The Builder instance.
    • withAutoIncrement

      public S withAutoIncrement(boolean autoIncrement)
      Sets whether the column is an auto-increment column.
      Parameters:
      autoIncrement - Whether the column is an auto-increment column.
      Returns:
      The Builder instance.
    • withDefaultValue

      public S withDefaultValue(Expression defaultValue)
      Sets the default value of the column.
      Parameters:
      defaultValue - The default value of the column.
      Returns:
      The Builder instance.
    • build

      public ColumnDTO build()
      Builds a Column DTO based on the provided builder parameters.
      Returns:
      A new ColumnDTO instance.
      Throws:
      NullPointerException - If required, fields name and data type are not set.