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) 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 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, matchesPath, modify, toString
-
-
-
-
Method Detail
-
modifyField
void modifyField(Map<String,Object> 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(Map<String,Object> 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
-
generateNewFieldName
String generateNewFieldName(String fieldName)
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
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
-
-