Package guru.mikelue.jdut.datagrain
Class SchemaColumn
- java.lang.Object
-
- guru.mikelue.jdut.datagrain.SchemaColumn
-
public class SchemaColumn extends Object
The definition of column of a table.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description classSchemaColumn.BuilderThis object is used withConsumerbybuild(java.util.function.Consumer<guru.mikelue.jdut.datagrain.SchemaColumn.Builder>).
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static SchemaColumnbuild(Consumer<SchemaColumn.Builder> builderConsumer)Builds a new column.protected SchemaColumnclone()booleanequals(Object obj)Only compares the name of column.Optional<Boolean>getAutoIncremental()Checks whether or not this column is auto-incremental.Optional<String>getDefaultValue()Gets value of default data.booleangetHasDefaultValue()Whether or not this column has default value.Optional<JDBCType>getJdbcType()Gets the value(optional) of sql type.StringgetName()Gets name of columnOptional<Boolean>getNullable()Whether or not this column is nullable.inthashCode()Hashed code by name of column.
-
-
-
Method Detail
-
build
public static SchemaColumn build(Consumer<SchemaColumn.Builder> builderConsumer)
Builds a new column.- Parameters:
builderConsumer- The editor for column- Returns:
- The new definition of column
-
getName
public String getName()
Gets name of column- Returns:
- The name of column
-
getJdbcType
public Optional<JDBCType> getJdbcType()
Gets the value(optional) of sql type.- Returns:
- The value of sql type
- See Also:
getColumns.getInt("DATA_TYPE")
-
getNullable
public Optional<Boolean> getNullable()
Whether or not this column is nullable.- Returns:
- may not be initialized
- See Also:
getColumns.getInt("NULLABLE")
-
getDefaultValue
public Optional<String> getDefaultValue()
Gets value of default data.- Returns:
- The optional default value
- See Also:
getColumns.getString("COLUMN_DEF")
-
getAutoIncremental
public Optional<Boolean> getAutoIncremental()
Checks whether or not this column is auto-incremental.- Returns:
- The flag may be unknown
-
getHasDefaultValue
public boolean getHasDefaultValue()
Whether or not this column has default value.- Returns:
- may not be initialized
- See Also:
getColumns.getString("COLUMN_DEF")
-
clone
protected SchemaColumn clone()
-
-