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 Details

    • fullyQualifiedFieldNames

      private String fullyQualifiedFieldNames
    • fullyQualifiedFieldReplacements

      private String fullyQualifiedFieldReplacements
  • Constructor Details

    • FieldSelectorBuilder

      private FieldSelectorBuilder()
  • Method Details

    • 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 be null or 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 be null or 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, see MongoDbConnectorConfig.FIELD_EXCLUDE_LIST) defining which fields (if any) should be excluded, and using the comma-separated list of fully-qualified field replacements (for details, see MongoDbConnectorConfig.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

      static String[] parseIntoParts(String name, String value, Predicate<Integer> lengthPredicate, Pattern delimiterPattern)
    • selectNamespacePartAsPattern

      private Pattern selectNamespacePartAsPattern(String[] expressionNodes)
    • toRegex

      private String toRegex(String value)
    • selectFieldPartAsNodes

      private String[] selectFieldPartAsNodes(String[] expressionNodes)