Package com.commercetools.sync.products
Class SyncFilter
- java.lang.Object
-
- com.commercetools.sync.products.SyncFilter
-
public final class SyncFilter extends java.lang.Object
Defines either a blacklist or a whitelist for filtering certain update action groups (ActionGroup
).The action groups can be a list of any of the values of the enum
ActionGroup
, namely:- ATTRIBUTES
- PRICES
- IMAGES
- CATEGORIES
- .. and others
The
includeOnly
flag defines whether the list is to be blacklisted (@code false) or whitelisted (@code true). A blacklist means that everything but these action groups will be synced. A whitelist means that only these action groups will be synced.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
filterActionGroup(ActionGroup actionGroup)
Checks if the suppliedActionGroup
passesthis
filter.static SyncFilter
of()
static SyncFilter
ofBlackList(ActionGroup... actionGroups)
static SyncFilter
ofWhiteList(ActionGroup... actionGroups)
-
-
-
Method Detail
-
ofWhiteList
@Nonnull public static SyncFilter ofWhiteList(@Nonnull ActionGroup... actionGroups)
-
ofBlackList
@Nonnull public static SyncFilter ofBlackList(@Nonnull ActionGroup... actionGroups)
-
of
@Nonnull public static SyncFilter of()
-
filterActionGroup
public boolean filterActionGroup(@Nonnull ActionGroup actionGroup)
Checks if the suppliedActionGroup
passesthis
filter.Passing the filter has an XOR logic as follows:
syncFilter filtering logic includeOnly actionGroups contains actionGroup passes filter false false true (actionGroup is not in blacklist) false true false (actionGroup is in blacklist) true false false (actionGroup is not in whitelist) true true true (actionGroup is in whitelist) - Parameters:
actionGroup
- the supplied action group to be tested if it passes the current filter.- Returns:
- true if the
ActionGroup
passesthis
filter, otherwise false.
-
-