Package io.debezium.connector.mongodb
Class FieldSelector.FieldSelectorBuilder
- java.lang.Object
-
- io.debezium.connector.mongodb.FieldSelector.FieldSelectorBuilder
-
- Enclosing class:
- FieldSelector
public static class FieldSelector.FieldSelectorBuilder extends Object
A builder of a field selector.
-
-
Field Summary
Fields Modifier and Type Field Description private StringfullyQualifiedFieldNamesprivate StringfullyQualifiedFieldReplacements
-
Constructor Summary
Constructors Modifier Constructor Description privateFieldSelectorBuilder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description FieldSelectorbuild()Builds the filter selector that returns the field filter for a given collection identifier, using the comma-separated list of fully-qualified field names (for details, seeMongoDbConnectorConfig.FIELD_EXCLUDE_LIST) defining which fields (if any) should be excluded, and using the comma-separated list of fully-qualified field replacements (for details, seeMongoDbConnectorConfig.FIELD_RENAMES) defining which fields (if any) should be renamed.FieldSelector.FieldSelectorBuilderexcludeFields(String fullyQualifiedFieldNames)Specifies the comma-separated list of fully-qualified field names that should be included.private voidparse(String value, Function<String,FieldSelector.Path> pathCreator, List<FieldSelector.Path> result)private String[]parseIntoParts(String name, String value, Predicate<Integer> lengthPredicate, Pattern delimiterPattern)FieldSelector.FieldSelectorBuilderrenameFields(String fullyQualifiedFieldReplacements)Specifies the comma-separated list of fully-qualified field replacements to rename fields.private String[]selectFieldPartAsNodes(String[] expressionNodes)private PatternselectNamespacePartAsPattern(String[] expressionNodes)private StringtoRegex(String value)
-
-
-
Method Detail
-
excludeFields
public FieldSelector.FieldSelectorBuilder excludeFields(String fullyQualifiedFieldNames)
Specifies the comma-separated list of fully-qualified field names that should be included.- Parameters:
fullyQualifiedFieldNames- the comma-separated list of fully-qualified field names to exclude; may benullor empty- Returns:
- this builder so that methods can be chained together; never
null
-
renameFields
public FieldSelector.FieldSelectorBuilder renameFields(String fullyQualifiedFieldReplacements)
Specifies the comma-separated list of fully-qualified field replacements to rename fields.- Parameters:
fullyQualifiedFieldReplacements- the comma-separated list of fully-qualified field replacements to rename fields; may benullor empty- Returns:
- this builder so that methods can be chained together; never
null
-
build
public FieldSelector build()
Builds the filter selector that returns the field filter for a given collection identifier, using the comma-separated list of fully-qualified field names (for details, seeMongoDbConnectorConfig.FIELD_EXCLUDE_LIST) defining which fields (if any) should be excluded, and using the comma-separated list of fully-qualified field replacements (for details, seeMongoDbConnectorConfig.FIELD_RENAMES) defining which fields (if any) should be renamed.- Returns:
- the filter selector that returns the filter to exclude or rename fields in a document
-
parse
private void parse(String value, Function<String,FieldSelector.Path> pathCreator, List<FieldSelector.Path> result)
-
parseIntoParts
private String[] parseIntoParts(String name, String value, Predicate<Integer> lengthPredicate, Pattern delimiterPattern)
-
selectNamespacePartAsPattern
private Pattern selectNamespacePartAsPattern(String[] expressionNodes)
-
-