Class DbColumn
- java.lang.Object
-
- com.feedzai.commons.sql.abstraction.ddl.DbColumn
-
- All Implemented Interfaces:
Serializable
public class DbColumn extends Object implements Serializable
Represents a database column definition.- Since:
- 2.0.0
- Author:
- Rui Vilao (rui.vilao@feedzai.com)
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classDbColumn.BuilderBuilder for creating immutableDbColumnobjects.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description List<DbColumnConstraint>getColumnConstraints()Gets the immutable list of constraints in the column.DbColumnTypegetDbColumnType()Gets the column type.KgetDefaultValue()Gets the default value,nullwhen not applicable.StringgetName()Gets column name.IntegergetSize()Gets the size of the column if applicable (e.g.booleanisAutoInc()Signals whether this column is auto incremental or not.booleanisDefaultValueSet()Signals if the default value is set or not.booleanisSizeSet()Signals if the size is set or not.DbColumn.BuildernewBuilder()Returns a new builder out of this configuration.
-
-
-
Method Detail
-
getName
public String getName()
Gets column name.- Returns:
- The column name.
-
getDbColumnType
public DbColumnType getDbColumnType()
Gets the column type.- Returns:
- The column type.
-
getSize
public Integer getSize()
Gets the size of the column if applicable (e.g. VARCHAR),nullis returned when not applicable.- Returns:
- The size or
nullif not applicable.
-
getColumnConstraints
public List<DbColumnConstraint> getColumnConstraints()
Gets the immutable list of constraints in the column.- Returns:
- The immutable list of column constraints.
-
isAutoInc
public boolean isAutoInc()
Signals whether this column is auto incremental or not.- Returns:
trueif the column is auto incremental,falseotherwise.
-
getDefaultValue
public K getDefaultValue()
Gets the default value,nullwhen not applicable.- Returns:
- The default value.
-
isDefaultValueSet
public boolean isDefaultValueSet()
Signals if the default value is set or not.- Returns:
trueif the default value is set,falseotherwise.
-
isSizeSet
public boolean isSizeSet()
Signals if the size is set or not.- Returns:
trueif the size is set,falseotherwise.
-
newBuilder
public DbColumn.Builder newBuilder()
Returns a new builder out of this configuration.- Returns:
- a new builder out of this configuration.
-
-