Package io.debezium.relational
Class ColumnImpl
- java.lang.Object
-
- io.debezium.relational.ColumnImpl
-
- All Implemented Interfaces:
Column
,Comparable<Column>
final class ColumnImpl extends Object implements Column, Comparable<Column>
-
-
Field Summary
Fields Modifier and Type Field Description private boolean
autoIncremented
private String
charsetName
private Object
defaultValue
private List<String>
enumValues
private boolean
generated
private boolean
hasDefaultValue
private int
jdbcType
private int
length
private String
name
private int
nativeType
private boolean
optional
private int
position
private Integer
scale
private String
typeExpression
private String
typeName
-
Fields inherited from interface io.debezium.relational.Column
UNSET_INT_VALUE
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
ColumnImpl(String columnName, int position, int jdbcType, int componentType, String typeName, String typeExpression, String charsetName, String defaultCharsetName, int columnLength, Integer columnScale, boolean optional, boolean autoIncremented, boolean generated)
protected
ColumnImpl(String columnName, int position, int jdbcType, int nativeType, String typeName, String typeExpression, String charsetName, String defaultCharsetName, int columnLength, Integer columnScale, boolean optional, boolean autoIncremented, boolean generated, Object defaultValue, boolean hasDefaultValue)
protected
ColumnImpl(String columnName, int position, int jdbcType, int nativeType, String typeName, String typeExpression, String charsetName, String defaultCharsetName, int columnLength, Integer columnScale, List<String> enumValues, boolean optional, boolean autoIncremented, boolean generated, Object defaultValue, boolean hasDefaultValue)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
charsetName()
Get the database-specific name of the character set used by this column.Object
defaultValue()
Get the default value of the columnColumnEditor
edit()
Obtain an editor that contains the same information as this column definition.List<String>
enumValues()
Get the list of values associated with the enumboolean
equals(Object obj)
boolean
hasDefaultValue()
Determine whether this column's has a default valueint
hashCode()
boolean
isAutoIncremented()
Determine whether this column's values are automatically incremented by the database.boolean
isGenerated()
Determine whether this column's values are generated by the database.boolean
isOptional()
Determine whether this column is optional.int
jdbcType()
Get theJDBC type
for this columnint
length()
Get the maximum length of this column's values.String
name()
Get the name of the column.int
nativeType()
Get the database native type for this columnint
position()
Get the position of the column in the table.Optional<Integer>
scale()
Get the scale of the column.String
toString()
String
typeExpression()
Get the database-specific complete expression defining the column's data type, including dimensions, length, precision, character sets, constraints, etc.String
typeName()
Get the database-specific name of the column's data type.-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface io.debezium.relational.Column
compareTo, isRequired, typeUsesCharset
-
-
-
-
Field Detail
-
name
private final String name
-
position
private final int position
-
jdbcType
private final int jdbcType
-
nativeType
private final int nativeType
-
typeName
private final String typeName
-
typeExpression
private final String typeExpression
-
charsetName
private final String charsetName
-
length
private final int length
-
scale
private final Integer scale
-
optional
private final boolean optional
-
autoIncremented
private final boolean autoIncremented
-
generated
private final boolean generated
-
defaultValue
private final Object defaultValue
-
hasDefaultValue
private final boolean hasDefaultValue
-
-
Constructor Detail
-
ColumnImpl
protected ColumnImpl(String columnName, int position, int jdbcType, int componentType, String typeName, String typeExpression, String charsetName, String defaultCharsetName, int columnLength, Integer columnScale, boolean optional, boolean autoIncremented, boolean generated)
-
ColumnImpl
protected ColumnImpl(String columnName, int position, int jdbcType, int nativeType, String typeName, String typeExpression, String charsetName, String defaultCharsetName, int columnLength, Integer columnScale, boolean optional, boolean autoIncremented, boolean generated, Object defaultValue, boolean hasDefaultValue)
-
ColumnImpl
protected ColumnImpl(String columnName, int position, int jdbcType, int nativeType, String typeName, String typeExpression, String charsetName, String defaultCharsetName, int columnLength, Integer columnScale, List<String> enumValues, boolean optional, boolean autoIncremented, boolean generated, Object defaultValue, boolean hasDefaultValue)
-
-
Method Detail
-
position
public int position()
Description copied from interface:Column
Get the position of the column in the table.
-
jdbcType
public int jdbcType()
Description copied from interface:Column
Get theJDBC type
for this column
-
nativeType
public int nativeType()
Description copied from interface:Column
Get the database native type for this column- Specified by:
nativeType
in interfaceColumn
- Returns:
- a type constant for the specific database
-
typeName
public String typeName()
Description copied from interface:Column
Get the database-specific name of the column's data type.
-
typeExpression
public String typeExpression()
Description copied from interface:Column
Get the database-specific complete expression defining the column's data type, including dimensions, length, precision, character sets, constraints, etc.- Specified by:
typeExpression
in interfaceColumn
- Returns:
- the complete type expression
-
charsetName
public String charsetName()
Description copied from interface:Column
Get the database-specific name of the character set used by this column.- Specified by:
charsetName
in interfaceColumn
- Returns:
- the database-specific character set name, or null if the column's data type doesn't
use character sets
or no character set is specified
-
length
public int length()
Description copied from interface:Column
Get the maximum length of this column's values. For numeric columns, this represents the precision.
-
scale
public Optional<Integer> scale()
Description copied from interface:Column
Get the scale of the column.
-
isOptional
public boolean isOptional()
Description copied from interface:Column
Determine whether this column is optional.- Specified by:
isOptional
in interfaceColumn
- Returns:
true
if it is optional, orfalse
otherwise- See Also:
Column.isRequired()
-
isAutoIncremented
public boolean isAutoIncremented()
Description copied from interface:Column
Determine whether this column's values are automatically incremented by the database.- Specified by:
isAutoIncremented
in interfaceColumn
- Returns:
true
if the values are auto-incremented, orfalse
otherwise
-
isGenerated
public boolean isGenerated()
Description copied from interface:Column
Determine whether this column's values are generated by the database.- Specified by:
isGenerated
in interfaceColumn
- Returns:
true
if the values are generated, orfalse
otherwise
-
defaultValue
public Object defaultValue()
Description copied from interface:Column
Get the default value of the column- Specified by:
defaultValue
in interfaceColumn
- Returns:
- the default value
-
hasDefaultValue
public boolean hasDefaultValue()
Description copied from interface:Column
Determine whether this column's has a default value- Specified by:
hasDefaultValue
in interfaceColumn
- Returns:
true
if the default value was provided, orfalse
otherwise
-
enumValues
public List<String> enumValues()
Description copied from interface:Column
Get the list of values associated with the enum- Specified by:
enumValues
in interfaceColumn
- Returns:
- the list of enum values
-
edit
public ColumnEditor edit()
Description copied from interface:Column
Obtain an editor that contains the same information as this column definition.
-
-