Class ComposableSnapshotFilter<K,V>

java.lang.Object
org.springframework.data.gemfire.snapshot.filter.ComposableSnapshotFilter<K,V>
All Implemented Interfaces:
Serializable, SnapshotFilter<K,V>

public class ComposableSnapshotFilter<K,V> extends Object implements 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
Author:
John Blum
See Also:
  • Method Details

    • compose

      protected static <K, V> SnapshotFilter<K,V> compose(ComposableSnapshotFilter.Operator operator, 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> SnapshotFilter<K,V> and(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> SnapshotFilter<K,V> or(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 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: