Spring Data for VMware GemFire
Class ComposableSnapshotFilter<K,V>
java.lang.Object
org.springframework.data.gemfire.snapshot.filter.ComposableSnapshotFilter<K,V>
- All Implemented Interfaces:
Serializable,org.apache.geode.cache.snapshot.SnapshotFilter<K,V>
public class ComposableSnapshotFilter<K,V>
extends Object
implements org.apache.geode.cache.snapshot.SnapshotFilter<K,V>
The ComposableSnapshotFilter class is a GemFire SnapshotFilter implementation of the Composition design pattern
allowing 2 or more SnapshotFilters to be combined by logical AND and OR operators acting as a single SnapshotFilter.
- Since:
- 1.7.0
- See Also:
-
SnapshotFilter- Serialized Form
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static enumOperator is an enumeration of logical operators (AND, OR) used to compose SnapshotFilters into a boolean expression. -
Method Summary
Modifier and TypeMethodDescriptionbooleanDetermines whether the following Map Entry is accepted by this composed SnapshotFilter implementation.static <K,V> org.apache.geode.cache.snapshot.SnapshotFilter<K, V> and(org.apache.geode.cache.snapshot.SnapshotFilter<K, V>... snapshotFilters) Composes the array of SnapshotFilters into a logical boolean expression using the AND Operator.protected static <K,V> org.apache.geode.cache.snapshot.SnapshotFilter<K, V> compose(ComposableSnapshotFilter.Operator operator, org.apache.geode.cache.snapshot.SnapshotFilter<K, V>... snapshotFilters) Composes the array of SnapshotFilters into a logical boolean expression using the specified Operator.static <K,V> org.apache.geode.cache.snapshot.SnapshotFilter<K, V> or(org.apache.geode.cache.snapshot.SnapshotFilter<K, V>... snapshotFilters) Composes the array of SnapshotFilters into a logical boolean expression using the OR Operator.
-
Method Details
-
compose
protected static <K,V> org.apache.geode.cache.snapshot.SnapshotFilter<K,V> compose(ComposableSnapshotFilter.Operator operator, org.apache.geode.cache.snapshot.SnapshotFilter<K, V>... snapshotFilters) Composes the array of SnapshotFilters into a logical boolean expression using the specified Operator.- Type Parameters:
K- the class type of the SnapshotFilter key.V- the class type of the SnapshotFilter value.- Parameters:
operator- the logical operator used to compose the SnapshotFilters.snapshotFilters- the array of SnapshotFilters to compose into a logical boolean expression using the Operator.- Returns:
- a SnapshotFilter implementation composed of the SnapshotFilters using the specified Operator.
- See Also:
-
ComposableSnapshotFilter.OperatorSnapshotFilter
-
and
public static <K,V> org.apache.geode.cache.snapshot.SnapshotFilter<K,V> and(org.apache.geode.cache.snapshot.SnapshotFilter<K, V>... snapshotFilters) Composes the array of SnapshotFilters into a logical boolean expression using the AND Operator.- Type Parameters:
K- the class type of the SnapshotFilter key.V- the class type of the SnapshotFilter value.- Parameters:
snapshotFilters- the array of SnapshotFilters to compose into a logical boolean expression using the AND Operator.- Returns:
- a SnapshotFilter implementation composed of the SnapshotFilters using the AND Operator.
- See Also:
-
ComposableSnapshotFilter.Operator.ANDSnapshotFilter
-
or
public static <K,V> org.apache.geode.cache.snapshot.SnapshotFilter<K,V> or(org.apache.geode.cache.snapshot.SnapshotFilter<K, V>... snapshotFilters) Composes the array of SnapshotFilters into a logical boolean expression using the OR Operator.- Type Parameters:
K- the class type of the SnapshotFilter key.V- the class type of the SnapshotFilter value.- Parameters:
snapshotFilters- the array of SnapshotFilters to compose into a logical boolean expression using the OR Operator.- Returns:
- a SnapshotFilter implementation composed of the SnapshotFilters using the OR Operator.
- See Also:
-
ComposableSnapshotFilter.Operator.ORSnapshotFilter
-
accept
Determines whether the following Map Entry is accepted by this composed SnapshotFilter implementation.- Specified by:
acceptin interfaceorg.apache.geode.cache.snapshot.SnapshotFilter<K,V> - Parameters:
entry- the Map.Entry to evaluate.- Returns:
- a boolean value indicating whether this composed SnapshotFilter accepts the Map Entry.
- See Also:
-
ComposableSnapshotFilter.OperatorSnapshotFilter.accept(Map.Entry)Map.Entry
-