Package io.debezium.relational
Class ColumnEditorImpl
java.lang.Object
io.debezium.relational.ColumnEditorImpl
- All Implemented Interfaces:
ColumnEditor
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionautoIncremented
(boolean autoIncremented) Set whether the column's values are automatically incremented.Get the database-specific name of the character set used by this column.charsetName
(String charsetName) Set the database-specific name of the character set used by this column.Get the database-specific name of the character set defined by this column's table, which is used if a character set is not explicitly set on this column.charsetNameOfTable
(String charsetName) Set the database-specific name of the character set defined by this column's table.comment()
Get the comment of the column.Set the comment of the columncreate()
Obtain an immutable column definition representing the current state of this editor.Get the database-specific complete expression defining the column's default value.defaultValueExpression
(String defaultValueExpression) Set the default value expression of the column;get the enumeration values for the column.enumValues
(List<String> enumValues) Set the list of enumeration values.generated
(boolean generated) Set whether the column's values are generated by the database.boolean
Determine whether this column's has a default value setboolean
Determine whether this column's values are automatically incremented by the database.boolean
Determine whether this column's values are generated by the database.boolean
Determine whether this column is optional.int
jdbcType()
Get theJDBC type
for this columnjdbcType
(int jdbcType) Set theJDBC type
of this column.int
length()
Get the maximum length of this column's values.length
(int length) Set the maximum length of this column's values.name()
Get the name of the column.Set the name of the column.int
Get the internal database-specific type identifier for this column.nativeType
(int nativeType) Set the native type for this column .optional
(boolean optional) Set whether the column's values are optional (e.g., can contain nulls).int
position()
Get the position of the column in the table.position
(int position) Set the position of the column within the table definition.scale()
Get the scale of the column.Set the scale of the column.toString()
Set the database-specific name of the column's data type.Set the database-specific name of the column's data type.Get the database-specific complete expression defining the column's data type, including dimensions, length, precision, character sets, constraints, etc.typeName()
Get the database-specific name of the column's data type.Unsets the default value expression of the column, reverting the editor to the state whereinvalid @link
{@link #defaultValueExpression(String))
Unsets theColumn.UNSET_INT_VALUE
to column's length.Unsets the null value to column's scale.
-
Field Details
-
name
-
jdbcType
private int jdbcType -
nativeType
private int nativeType -
typeName
-
typeExpression
-
charsetName
-
tableCharsetName
-
length
private int length -
scale
-
position
private int position -
optional
private boolean optional -
autoIncremented
private boolean autoIncremented -
generated
private boolean generated -
defaultValueExpression
-
hasDefaultValue
private boolean hasDefaultValue -
enumValues
-
comment
-
-
Constructor Details
-
ColumnEditorImpl
protected ColumnEditorImpl()
-
-
Method Details
-
name
Description copied from interface:ColumnEditor
Get the name of the column.- Specified by:
name
in interfaceColumnEditor
- Returns:
- the column name; may be null if not set
-
typeName
Description copied from interface:ColumnEditor
Get the database-specific name of the column's data type.- Specified by:
typeName
in interfaceColumnEditor
- Returns:
- the name of the type; may be null if not set
-
typeExpression
Description copied from interface:ColumnEditor
Get the database-specific complete expression defining the column's data type, including dimensions, length, precision, character sets, constraints, etc.- Specified by:
typeExpression
in interfaceColumnEditor
- Returns:
- the complete type expression
-
jdbcType
public int jdbcType()Description copied from interface:ColumnEditor
Get theJDBC type
for this column- Specified by:
jdbcType
in interfaceColumnEditor
- Returns:
- the type constant
-
nativeType
public int nativeType()Description copied from interface:ColumnEditor
Get the internal database-specific type identifier for this column.- Specified by:
nativeType
in interfaceColumnEditor
- Returns:
- a type constant for the specific database
-
charsetName
Description copied from interface:ColumnEditor
Get the database-specific name of the character set used by this column.- Specified by:
charsetName
in interfaceColumnEditor
- 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
-
charsetNameOfTable
Description copied from interface:ColumnEditor
Get the database-specific name of the character set defined by this column's table, which is used if a character set is not explicitly set on this column.- Specified by:
charsetNameOfTable
in interfaceColumnEditor
- Returns:
- the database-specific character set name defined for this column's table, or null if not defined
-
length
public int length()Description copied from interface:ColumnEditor
Get the maximum length of this column's values. For numeric columns, this represents the precision.- Specified by:
length
in interfaceColumnEditor
- Returns:
- the length of the column
-
scale
Description copied from interface:ColumnEditor
Get the scale of the column.- Specified by:
scale
in interfaceColumnEditor
- Returns:
- the scale if present
-
position
public int position()Description copied from interface:ColumnEditor
Get the position of the column in the table.- Specified by:
position
in interfaceColumnEditor
- Returns:
- the 1-based position
-
isOptional
public boolean isOptional()Description copied from interface:ColumnEditor
Determine whether this column is optional.- Specified by:
isOptional
in interfaceColumnEditor
- Returns:
true
if it is optional, orfalse
otherwise
-
isAutoIncremented
public boolean isAutoIncremented()Description copied from interface:ColumnEditor
Determine whether this column's values are automatically incremented by the database.- Specified by:
isAutoIncremented
in interfaceColumnEditor
- Returns:
true
if the values are auto-incremented, orfalse
otherwise
-
isGenerated
public boolean isGenerated()Description copied from interface:ColumnEditor
Determine whether this column's values are generated by the database.- Specified by:
isGenerated
in interfaceColumnEditor
- Returns:
true
if the values are generated, orfalse
otherwise
-
defaultValueExpression
Description copied from interface:ColumnEditor
Get the database-specific complete expression defining the column's default value.- Specified by:
defaultValueExpression
in interfaceColumnEditor
- Returns:
- the complete type expression
-
hasDefaultValue
public boolean hasDefaultValue()Description copied from interface:ColumnEditor
Determine whether this column's has a default value set- Specified by:
hasDefaultValue
in interfaceColumnEditor
- Returns:
true
if the default value was provided, orfalse
otherwise
-
comment
Description copied from interface:ColumnEditor
Get the comment of the column.- Specified by:
comment
in interfaceColumnEditor
- Returns:
- the column comment; may be null if not set
-
name
Description copied from interface:ColumnEditor
Set the name of the column.- Specified by:
name
in interfaceColumnEditor
- Parameters:
name
- the column name- Returns:
- this editor so callers can chain methods together
-
enumValues
Description copied from interface:ColumnEditor
get the enumeration values for the column.- Specified by:
enumValues
in interfaceColumnEditor
- Returns:
- the list of enumeration values
-
type
Description copied from interface:ColumnEditor
Set the database-specific name of the column's data type.- Specified by:
type
in interfaceColumnEditor
- Parameters:
typeName
- the column's type name- Returns:
- this editor so callers can chain methods together
-
type
Description copied from interface:ColumnEditor
Set the database-specific name of the column's data type. The expression includes the column'stype name
and also any dimensions, lengths, precisions, character sets, etc.- Specified by:
type
in interfaceColumnEditor
- Parameters:
typeName
- the column's type nametypeExpression
- the column's complete type expression- Returns:
- this editor so callers can chain methods together
-
jdbcType
Description copied from interface:ColumnEditor
Set theJDBC type
of this column.- Specified by:
jdbcType
in interfaceColumnEditor
- Parameters:
jdbcType
-JDBC type
for this column- Returns:
- this editor so callers can chain methods together
-
nativeType
Description copied from interface:ColumnEditor
Set the native type for this column . This is database specific.- Specified by:
nativeType
in interfaceColumnEditor
- Returns:
- a type constant for the specific database
-
charsetName
Description copied from interface:ColumnEditor
Set the database-specific name of the character set used by this column.- Specified by:
charsetName
in interfaceColumnEditor
- Parameters:
charsetName
- the database-specific character set name; may be null- Returns:
- this editor so callers can chain methods together
-
charsetNameOfTable
Description copied from interface:ColumnEditor
Set the database-specific name of the character set defined by this column's table.- Specified by:
charsetNameOfTable
in interfaceColumnEditor
- Parameters:
charsetName
- the database-specific character set name; may be null- Returns:
- this editor so callers can chain methods together
-
length
Description copied from interface:ColumnEditor
Set the maximum length of this column's values. For numeric columns, this represents the precision.- Specified by:
length
in interfaceColumnEditor
- Parameters:
length
- the column's length- Returns:
- this editor so callers can chain methods together
-
scale
Description copied from interface:ColumnEditor
Set the scale of the column.- Specified by:
scale
in interfaceColumnEditor
- Parameters:
scale
- the scale ornull
to unset- Returns:
- this editor so callers can chain methods together
-
optional
Description copied from interface:ColumnEditor
Set whether the column's values are optional (e.g., can contain nulls).- Specified by:
optional
in interfaceColumnEditor
- Parameters:
optional
-true
if the column's values are optional, orfalse
otherwise- Returns:
- this editor so callers can chain methods together
-
autoIncremented
Description copied from interface:ColumnEditor
Set whether the column's values are automatically incremented.- Specified by:
autoIncremented
in interfaceColumnEditor
- Parameters:
autoIncremented
-true
if the column's values are automatically incremented by the database, orfalse
otherwise- Returns:
- this editor so callers can chain methods together
-
generated
Description copied from interface:ColumnEditor
Set whether the column's values are generated by the database.- Specified by:
generated
in interfaceColumnEditor
- Parameters:
generated
-true
if the column's values are generated by the database, orfalse
otherwise- Returns:
- this editor so callers can chain methods together
-
position
Description copied from interface:ColumnEditor
Set the position of the column within the table definition.- Specified by:
position
in interfaceColumnEditor
- Parameters:
position
- the new column position- Returns:
- this editor so callers can chain methods together
-
defaultValueExpression
Description copied from interface:ColumnEditor
Set the default value expression of the column;- Specified by:
defaultValueExpression
in interfaceColumnEditor
- Parameters:
defaultValueExpression
- the default value expression- Returns:
- this editor so callers can chain methods together
-
unsetDefaultValueExpression
Description copied from interface:ColumnEditor
Unsets the default value expression of the column, reverting the editor to the state whereinvalid @link
{@link #defaultValueExpression(String))
- Specified by:
unsetDefaultValueExpression
in interfaceColumnEditor
- Returns:
- this editor so callers can chain methods together
-
unsetLength
Description copied from interface:ColumnEditor
Unsets theColumn.UNSET_INT_VALUE
to column's length.- Specified by:
unsetLength
in interfaceColumnEditor
- Returns:
- this editor so callers can chain methods together
-
unsetScale
Description copied from interface:ColumnEditor
Unsets the null value to column's scale.- Specified by:
unsetScale
in interfaceColumnEditor
- Returns:
- this editor so callers can chain methods together
-
enumValues
Description copied from interface:ColumnEditor
Set the list of enumeration values.- Specified by:
enumValues
in interfaceColumnEditor
- Parameters:
enumValues
- the enumeration values- Returns:
- this editor so callers can chain methods together
-
comment
Description copied from interface:ColumnEditor
Set the comment of the column- Specified by:
comment
in interfaceColumnEditor
- Parameters:
comment
- column comment- Returns:
- this editor so callers can chain methods together
-
create
Description copied from interface:ColumnEditor
Obtain an immutable column definition representing the current state of this editor. Typically, an editor is created and used to build a column, and then discarded. However, this editor with its current state can be reused after this method, since the resulting column definition no longer refers to any of the data used in this editor.- Specified by:
create
in interfaceColumnEditor
- Returns:
- the immutable column definition; never null
-
toString
-