Package io.debezium.relational
Interface Table
-
- All Known Implementing Classes:
TableImpl
@Immutable public interface Table
An immutable definition of a table.
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description List<Column>columns()Get the definitions for the columns in this table, in the same order in which the table defines them.ColumncolumnWithName(String name)Get the definition for the column in this table with the supplied name.StringdefaultCharsetName()Get the database-specific name of the default character set used by columns in this table.TableEditoredit()Obtain an editor that contains the same information as this table definition.static TableEditoreditor()Obtain an table definition editor that can be used to define a table.default List<Column>filterColumns(Predicate<Column> predicate)Utility to obtain a copy of a list of the columns that satisfy the specified predicate.TableIdid()Get the identifier for this table.default booleanisAutoIncremented(String columnName)Determine if the named column is auto-incremented.default booleanisGenerated(String columnName)Determine if the values in the named column is generated by the database.default booleanisOptional(String columnName)Determine if the values in the named column is optional.default booleanisPrimaryKeyColumn(String columnName)Determine if the named column is part of the primary key.List<String>primaryKeyColumnNames()The list of column names that make up the primary key for this table.default List<Column>primaryKeyColumns()Get the columns that make up the primary key for this table.List<String>retrieveColumnNames()The list of column names that make up this table.
-
-
-
Method Detail
-
editor
static TableEditor editor()
Obtain an table definition editor that can be used to define a table.- Returns:
- the editor; never null
-
id
TableId id()
Get the identifier for this table.- Returns:
- the identifier; never null
-
primaryKeyColumnNames
List<String> primaryKeyColumnNames()
The list of column names that make up the primary key for this table.- Returns:
- the immutable list of column names that make up the primary key; never null but possibly empty
-
primaryKeyColumns
default List<Column> primaryKeyColumns()
Get the columns that make up the primary key for this table.- Returns:
- the immutable list of columns that make up the primary key; never null but possibly empty
-
filterColumns
default List<Column> filterColumns(Predicate<Column> predicate)
Utility to obtain a copy of a list of the columns that satisfy the specified predicate.- Parameters:
predicate- the filter predicate; may not be null- Returns:
- the list of columns that satisfy the predicate; never null but possibly empty
-
retrieveColumnNames
List<String> retrieveColumnNames()
The list of column names that make up this table.Note: If feasible, call
columns()instead, e.g. if just interested in the number of columns.- Returns:
- the immutable list of column names ; never null but possibly empty
-
columns
List<Column> columns()
Get the definitions for the columns in this table, in the same order in which the table defines them.- Returns:
- the immutable and ordered list of definitions; never null
-
columnWithName
Column columnWithName(String name)
Get the definition for the column in this table with the supplied name. The case of the supplied name does not matter.- Parameters:
name- the case-insensitive name of the column- Returns:
- the column definition, or null if there is no column with the given name
-
defaultCharsetName
String defaultCharsetName()
Get the database-specific name of the default character set used by columns in this table.- Returns:
- the database-specific character set name used by default in columns of this table, or
nullif there is no such default character set name defined on the table
-
isPrimaryKeyColumn
default boolean isPrimaryKeyColumn(String columnName)
Determine if the named column is part of the primary key.- Parameters:
columnName- the name of the column- Returns:
trueif a column exists in this table and it is part of the primary key, orfalseotherwise
-
isAutoIncremented
default boolean isAutoIncremented(String columnName)
Determine if the named column is auto-incremented.- Parameters:
columnName- the name of the column- Returns:
trueif a column exists in this table and it is auto-incremented, orfalseotherwise
-
isGenerated
default boolean isGenerated(String columnName)
Determine if the values in the named column is generated by the database.- Parameters:
columnName- the name of the column- Returns:
trueif a column exists in this table and its values are generated, orfalseotherwise
-
isOptional
default boolean isOptional(String columnName)
Determine if the values in the named column is optional.- Parameters:
columnName- the name of the column- Returns:
trueif a column exists in this table and is optional, orfalseotherwise
-
edit
TableEditor edit()
Obtain an editor that contains the same information as this table definition.- Returns:
- the editor; never null
-
-