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
@ThreadSafe private static final class FieldSelector.RenamePath extends FieldSelector.Path
-
-
Field Summary
Fields Modifier and Type Field Description private StringnewFieldprivate StringnewFieldNode-
Fields inherited from class io.debezium.connector.mongodb.FieldSelector.Path
field, fieldNodes, namespacePattern
-
-
Constructor Summary
Constructors Modifier Constructor Description privateRenamePath(Pattern namespacePattern, String[] oldFieldNodes, String newFieldNode)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) FieldSelector.FieldNameAndValuegenerateNewFieldName(String[] fieldNodes, Object value)Generates a new field name for the given value.(package private) voidmodifyField(org.bson.Document doc, String field)Modifies the field in the document used for read, insert and full update operations.(package private) voidmodifyFieldWithDotNotation(org.bson.Document 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 Stringrename(String[] nameNodes)private 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, modify, toString
-
-
-
-
Method Detail
-
modifyField
void modifyField(org.bson.Document doc, String field)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
void modifyFieldWithDotNotation(org.bson.Document doc, String field)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
FieldSelector.FieldNameAndValue generateNewFieldName(String[] fieldNodes, Object value)
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
-
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 replacelastNameNode- the last name node- Returns:
- replaced name or last name node
-
-