Package org.apache.gravitino.dto.rel
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
Builder class for constructing ColumnDTO instances.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected boolean
Whether the column is an auto-increment column.protected String
The comment associated with the column.protected Type
The data type of the column.protected Expression
The default value of the column.protected String
The name of the column.protected boolean
Whether the column value can be null. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()
Builds a Column DTO based on the provided builder parameters.withAutoIncrement
(boolean autoIncrement) Sets whether the column is an auto-increment column.withComment
(String comment) Sets the comment associated with the column.withDataType
(Type dataType) Sets the data type of the column.withDefaultValue
(Expression defaultValue) Sets the default value of the column.Sets the name of the column.withNullable
(boolean nullable) Sets whether the column value can be null.
-
Field Details
-
name
The name of the column. -
dataType
The data type of the column. -
comment
The comment associated with the column. -
nullable
protected boolean nullableWhether the column value can be null. -
autoIncrement
protected boolean autoIncrementWhether the column is an auto-increment column. -
defaultValue
The default value of the column.
-
-
Constructor Details
-
Builder
public Builder()Constructs a new Builder.
-
-
Method Details
-
withName
Sets the name of the column.- Parameters:
name
- The name of the column.- Returns:
- The Builder instance.
-
withDataType
Sets the data type of the column.- Parameters:
dataType
- The data type of the column.- Returns:
- The Builder instance.
-
withComment
Sets the comment associated with the column.- Parameters:
comment
- The comment associated with the column.- Returns:
- The Builder instance.
-
withNullable
Sets whether the column value can be null.- Parameters:
nullable
- Whether the column value can be null.- Returns:
- The Builder instance.
-
withAutoIncrement
Sets whether the column is an auto-increment column.- Parameters:
autoIncrement
- Whether the column is an auto-increment column.- Returns:
- The Builder instance.
-
withDefaultValue
Sets the default value of the column.- Parameters:
defaultValue
- The default value of the column.- Returns:
- The Builder instance.
-
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.
-