Package io.debezium.connector.mongodb
Class Filters
- java.lang.Object
-
- io.debezium.connector.mongodb.Filters
-
public final class Filters extends Object
A utility that is contains various filters for acceptable database names,CollectionIds, and fields.- Author:
- Randall Hauch
-
-
Field Summary
Fields Modifier and Type Field Description protected static Set<String>BUILT_IN_DB_NAMESprivate Predicate<CollectionId>collectionFilterprivate Predicate<String>databaseFilterprivate FieldSelectorfieldSelector
-
Constructor Summary
Constructors Constructor Description Filters(Configuration config)Create an instance of the filters.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Predicate<CollectionId>collectionFilter()Get the predicate function that determines whether the given collection is to be included.Predicate<String>databaseFilter()Get the predicate function that determines whether the given database is to be included.FieldSelector.FieldFilterfieldFilterFor(CollectionId id)Get the field filter for a given collection identifier.protected booleanisNotBuiltIn(CollectionId id)
-
-
-
Field Detail
-
collectionFilter
private final Predicate<CollectionId> collectionFilter
-
fieldSelector
private final FieldSelector fieldSelector
-
-
Constructor Detail
-
Filters
public Filters(Configuration config)
Create an instance of the filters.- Parameters:
config- the configuration; may not be null
-
-
Method Detail
-
databaseFilter
public Predicate<String> databaseFilter()
Get the predicate function that determines whether the given database is to be included.- Returns:
- the database filter; never null
-
collectionFilter
public Predicate<CollectionId> collectionFilter()
Get the predicate function that determines whether the given collection is to be included.- Returns:
- the collection filter; never null
-
fieldFilterFor
public FieldSelector.FieldFilter fieldFilterFor(CollectionId id)
Get the field filter for a given collection identifier.- Parameters:
id- the collection identifier, never null- Returns:
- the field filter; never null
-
isNotBuiltIn
protected boolean isNotBuiltIn(CollectionId id)
-
-