Class FieldSelector.RenamePath

java.lang.Object
io.debezium.connector.mongodb.FieldSelector.Path
io.debezium.connector.mongodb.FieldSelector.RenamePath
Enclosing class:
FieldSelector

@ThreadSafe private static final class FieldSelector.RenamePath extends FieldSelector.Path
  • Field Details

    • newFieldNode

      private final String newFieldNode
    • newField

      private final String newField
  • Constructor Details

    • RenamePath

      private RenamePath(Pattern namespacePattern, String[] oldFieldNodes, String newFieldNode)
  • Method Details

    • modifyField

      void modifyField(Map<String,Object> doc, String field)
      Description copied from class: FieldSelector.Path
      Modifies the field in the document used for read, insert and full update operations.
      Specified by:
      modifyField in class FieldSelector.Path
      Parameters:
      doc - the document to modify field
      field - the modified field
    • modifyFieldWithDotNotation

      void modifyFieldWithDotNotation(Map<String,Object> doc, String field)
      Description copied from class: FieldSelector.Path
      Immediately modifies the field that uses the dot notation like 'a.b' in the document used for set and unset update operations.
      Specified by:
      modifyFieldWithDotNotation in class FieldSelector.Path
      Parameters:
      doc - the document to modify field
      field - the modified field
    • generateNewFieldName

      FieldSelector.FieldNameAndValue generateNewFieldName(String[] fieldNodes, Object value)
      Description copied from class: FieldSelector.Path
      Generates a new field name for the given value.
      Specified by:
      generateNewFieldName in class FieldSelector.Path
      Parameters:
      fieldNodes - the field nodes
      value - the field value
      Returns:
      a new field name for the given value
    • generateNewFieldName

      String generateNewFieldName(String fieldName)
      Description copied from class: FieldSelector.Path
      Generates a new field name.
      Specified by:
      generateNewFieldName in class FieldSelector.Path
      Parameters:
      fieldName - the original field name
      Returns:
      a new field name
    • replaceLastNameNode

      private String replaceLastNameNode(String[] nameNodes, String lastNameNode)
      Replaces a last name node in the given name nodes, if the name nodes contain only one node, the last name node is returned.
      Parameters:
      nameNodes - the name nodes to replace
      lastNameNode - the last name node
      Returns:
      replaced name or last name node
    • rename

      private String rename(String[] nameNodes)