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:
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    protected static enum 
    Operator is an enumeration of logical operators (AND, OR) used to compose SnapshotFilters into a boolean expression.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    accept(Map.Entry<K,V> entry)
    Determines 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.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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:
    • 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:
    • 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:
    • accept

      public boolean accept(Map.Entry<K,V> entry)
      Determines whether the following Map Entry is accepted by this composed SnapshotFilter implementation.
      Specified by:
      accept in interface org.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: