Class NoOpTableEditorImpl

java.lang.Object
io.debezium.relational.NoOpTableEditorImpl
All Implemented Interfaces:
TableEditor

final class NoOpTableEditorImpl extends Object implements TableEditor
  • Field Details

    • id

      private TableId id
    • uniqueValues

      private boolean uniqueValues
    • defaultCharsetName

      private String defaultCharsetName
    • comment

      private String comment
  • Constructor Details

    • NoOpTableEditorImpl

      protected NoOpTableEditorImpl()
  • Method Details

    • tableId

      public TableId tableId()
      Description copied from interface: TableEditor
      Get the identifier for this table.
      Specified by:
      tableId in interface TableEditor
      Returns:
      the table identifier; may be null if not set
    • tableId

      public TableEditor tableId(TableId id)
      Description copied from interface: TableEditor
      Set the table identifier.
      Specified by:
      tableId in interface TableEditor
      Parameters:
      id - the table identifier
      Returns:
      this editor so callers can chain methods together
    • columns

      public List<Column> columns()
      Description copied from interface: TableEditor
      Get the definitions for the columns in this table. The resulting list should not be modified directly; instead, the column definitions should be defined with TableEditor.addColumns(Column...), TableEditor.addColumns(Iterable), TableEditor.setColumns(Column...), TableEditor.setColumns(Iterable), or TableEditor.removeColumn(String).
      Specified by:
      columns in interface TableEditor
      Returns:
      the ordered list of definitions; never null
    • columnWithName

      public Column columnWithName(String name)
      Description copied from interface: TableEditor
      Get the definition for the column in this table with the supplied name. The case of the supplied name does not matter.
      Specified by:
      columnWithName in interface TableEditor
      Parameters:
      name - the case-insensitive name of the column
      Returns:
      the column definition, or null if there is no column with the given name
    • hasColumnWithName

      protected boolean hasColumnWithName(String name)
    • primaryKeyColumnNames

      public List<String> primaryKeyColumnNames()
      Description copied from interface: TableEditor
      The list of column names that make up the primary key for this table. The resulting list should not be modified directly; instead, the set of primary key names should be defined with TableEditor.setPrimaryKeyNames(String...).
      Specified by:
      primaryKeyColumnNames in interface TableEditor
      Returns:
      the list of column names that make up the primary key; never null but possibly empty
    • addColumns

      public TableEditor addColumns(Column... columns)
      Description copied from interface: TableEditor
      Add one or more columns to this table, regardless of the position of the supplied columns. However, if an existing column definition matches a supplied column, the new column definition will replace the existing column definition.
      Specified by:
      addColumns in interface TableEditor
      Parameters:
      columns - the definitions for the columns to be added
      Returns:
      this editor so callers can chain methods together
    • addColumns

      public TableEditor addColumns(Iterable<Column> columns)
      Description copied from interface: TableEditor
      Add one or more columns to the end of this table's list of columns, regardless of the position of the supplied columns. However, if an existing column definition matches a supplied column, the new column definition will replace the existing column definition.
      Specified by:
      addColumns in interface TableEditor
      Parameters:
      columns - the definitions for the columns to be added
      Returns:
      this editor so callers can chain methods together
    • setColumns

      public TableEditor setColumns(Column... columns)
      Description copied from interface: TableEditor
      Set this table's column definitions. The table's primary key columns may be removed as a result of this method if they refer to columns that are not in the supplied list of column definitions.
      Specified by:
      setColumns in interface TableEditor
      Parameters:
      columns - the definitions for the columns to be added
      Returns:
      this editor so callers can chain methods together
    • setColumns

      public TableEditor setColumns(Iterable<Column> columns)
      Description copied from interface: TableEditor
      Set this table's column definitions. The table's primary key columns may be removed as a result of this method if they refer to columns that are not in the supplied list of column definitions.
      Specified by:
      setColumns in interface TableEditor
      Parameters:
      columns - the definitions for the columns to be added
      Returns:
      this editor so callers can chain methods together
    • setPrimaryKeyNames

      public TableEditor setPrimaryKeyNames(String... pkColumnNames)
      Description copied from interface: TableEditor
      Set the columns that make up this table's primary key.
      Specified by:
      setPrimaryKeyNames in interface TableEditor
      Parameters:
      pkColumnNames - the names of this tables columns that make up the primary key
      Returns:
      this editor so callers can chain methods together
    • setPrimaryKeyNames

      public TableEditor setPrimaryKeyNames(List<String> pkColumnNames)
      Description copied from interface: TableEditor
      Set the columns that make up this table's primary key.
      Specified by:
      setPrimaryKeyNames in interface TableEditor
      Parameters:
      pkColumnNames - the names of this tables columns that make up the primary key
      Returns:
      this editor so callers can chain methods together
    • setUniqueValues

      public TableEditor setUniqueValues()
      Description copied from interface: TableEditor
      Sets this table's primary key to contain all columns, ensuring that all values are unique within the table. This is analogous to calling setPrimaryKeyNames(columnNames()) except that the primary key is updated when columns are added or removed.
      Specified by:
      setUniqueValues in interface TableEditor
      Returns:
      this editor so callers can chain methods together
    • hasUniqueValues

      public boolean hasUniqueValues()
      Description copied from interface: TableEditor
      Determine whether this table's primary key contains all columns (via TableEditor.setUniqueValues()) such that all rows within the table are unique.
      Specified by:
      hasUniqueValues in interface TableEditor
      Returns:
      true if TableEditor.setUniqueValues() was last called on this table, or false otherwise
    • setDefaultCharsetName

      public TableEditor setDefaultCharsetName(String charsetName)
      Description copied from interface: TableEditor
      Set the name of the character set that should be used by default in the columns that require a character set but have not defined one.
      Specified by:
      setDefaultCharsetName in interface TableEditor
      Parameters:
      charsetName - the name of the character set that should be used by default
      Returns:
      this editor so callers can chain methods together
    • setComment

      public TableEditor setComment(String comment)
      Description copied from interface: TableEditor
      Set the comment of the table
      Specified by:
      setComment in interface TableEditor
      Parameters:
      comment - table comment
      Returns:
      this editor so callers can chain methods together
    • hasDefaultCharsetName

      public boolean hasDefaultCharsetName()
      Description copied from interface: TableEditor
      Determine if a default character set has been set on this table.
      Specified by:
      hasDefaultCharsetName in interface TableEditor
      Returns:
      true if this has a default character set, or false if one has not yet been set
    • hasComment

      public boolean hasComment()
      Description copied from interface: TableEditor
      Determine if a comment has been set on this table.
      Specified by:
      hasComment in interface TableEditor
      Returns:
      true if this has a comment, or false if one has not yet been set
    • removeColumn

      public TableEditor removeColumn(String columnName)
      Description copied from interface: TableEditor
      Remove the column with the given name. This method does nothing if no such column exists.
      Specified by:
      removeColumn in interface TableEditor
      Parameters:
      columnName - the name of the column to be removed
      Returns:
      this editor so callers can chain methods together
    • updateColumn

      public TableEditor updateColumn(Column column)
      Description copied from interface: TableEditor
      Update the column with the given name. The existing column definition with the name as the column provided is replaced with the new one.
      Specified by:
      updateColumn in interface TableEditor
      Parameters:
      column - the new column definition
      Returns:
      this editor so callers can chain methods together
    • reorderColumn

      public TableEditor reorderColumn(String columnName, String afterColumnName)
      Description copied from interface: TableEditor
      Reorder the column with the given name to be positioned after the designated column. If afterColumnName is null, the column will be moved to the first column.
      Specified by:
      reorderColumn in interface TableEditor
      Parameters:
      columnName - the name of the column to be removed
      afterColumnName - the name of the column after which the moved column is to be positioned; may be null if the column is to be moved to the first column
      Returns:
      this editor so callers can chain methods together
    • renameColumn

      public TableEditor renameColumn(String existingName, String newName)
      Description copied from interface: TableEditor
      Rename the column with the given name to the new specified name.
      Specified by:
      renameColumn in interface TableEditor
      Parameters:
      existingName - the existing name of the column to be renamed; may not be null
      newName - the new name of the column; may not be null
      Returns:
      this editor so callers can chain methods together
    • attributes

      public List<Attribute> attributes()
      Description copied from interface: TableEditor
      Get the definitions for the attributes in this table. The resulting list should not be modified directly; instead, the attributes definitions should be defined with TableEditor.addAttribute(Attribute) or TableEditor.removeAttribute(String).
      Specified by:
      attributes in interface TableEditor
      Returns:
      the list of attribute definitions; never null
    • attributeWithName

      public Attribute attributeWithName(String attributeName)
      Description copied from interface: TableEditor
      Get the definition for the attribute in this table with the supplied name. The case of the supplied name does not matter.
      Specified by:
      attributeWithName in interface TableEditor
      Parameters:
      attributeName - the attribute name
      Returns:
      the attribute definition; or null if no attribute exists with the given name
    • addAttribute

      public TableEditor addAttribute(Attribute attribute)
      Description copied from interface: TableEditor
      Add a new attribute to this table.
      Specified by:
      addAttribute in interface TableEditor
      Parameters:
      attribute - the definition for the attribute to be added
      Returns:
      this editor so callers can chain methods together
    • addAttributes

      public TableEditor addAttributes(List<Attribute> attributes)
      Description copied from interface: TableEditor
      Add attributes to this table.
      Specified by:
      addAttributes in interface TableEditor
      Parameters:
      attributes - the list of attribute definitions to be added
      Returns:
      this editor so callers can chain methods together
    • removeAttribute

      public TableEditor removeAttribute(String attributeName)
      Description copied from interface: TableEditor
      Remove an attribute from this table.
      Specified by:
      removeAttribute in interface TableEditor
      Parameters:
      attributeName - the name of the attribute to be removed
      Returns:
      this editor so callers can chain methods togethe
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • create

      public Table create()
      Description copied from interface: TableEditor
      Obtain an immutable table definition representing the current state of this editor. This editor can be reused after this method, since the resulting table definition no longer refers to any of the data used in this editor.
      Specified by:
      create in interface TableEditor
      Returns:
      the immutable table definition; never null