Package io.debezium.connector.mongodb
Class FieldSelector.RenamePath
java.lang.Object
io.debezium.connector.mongodb.FieldSelector.Path
io.debezium.connector.mongodb.FieldSelector.RenamePath
- Enclosing class:
- FieldSelector
-
Field Summary
FieldsFields inherited from class io.debezium.connector.mongodb.FieldSelector.Path
field, fieldNodes, namespacePattern -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateRenamePath(Pattern namespacePattern, String[] oldFieldNodes, String newFieldNode) -
Method Summary
Modifier and TypeMethodDescription(package private) StringgenerateNewFieldName(String fieldName) Generates a new field name.(package private) FieldSelector.FieldNameAndValuegenerateNewFieldName(String[] fieldNodes, Object value) Generates a new field name for the given value.(package private) voidmodifyField(Map<String, Object> doc, String field) Modifies the field in the document used for read, insert and full update operations.(package private) voidmodifyFieldWithDotNotation(Map<String, Object> doc, String field) Immediately modifies the field that uses the dot notation like'a.b'in the document used for set and unset update operations.private Stringprivate StringreplaceLastNameNode(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.Methods inherited from class io.debezium.connector.mongodb.FieldSelector.Path
checkFieldExists, matches, matchesPath, modify, toString
-
Field Details
-
newFieldNode
-
newField
-
-
Constructor Details
-
RenamePath
-
-
Method Details
-
modifyField
Description copied from class:FieldSelector.PathModifies the field in the document used for read, insert and full update operations.- Specified by:
modifyFieldin classFieldSelector.Path- Parameters:
doc- the document to modify fieldfield- the modified field
-
modifyFieldWithDotNotation
Description copied from class:FieldSelector.PathImmediately modifies the field that uses the dot notation like'a.b'in the document used for set and unset update operations.- Specified by:
modifyFieldWithDotNotationin classFieldSelector.Path- Parameters:
doc- the document to modify fieldfield- the modified field
-
generateNewFieldName
Description copied from class:FieldSelector.PathGenerates a new field name for the given value.- Specified by:
generateNewFieldNamein classFieldSelector.Path- Parameters:
fieldNodes- the field nodesvalue- the field value- Returns:
- a new field name for the given value
-
generateNewFieldName
Description copied from class:FieldSelector.PathGenerates a new field name.- Specified by:
generateNewFieldNamein classFieldSelector.Path- Parameters:
fieldName- the original field name- Returns:
- a new field name
-
replaceLastNameNode
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 replacelastNameNode- the last name node- Returns:
- replaced name or last name node
-
rename
-