Interface Filter<T>

Type Parameters:
T - the type of the input argument to the filter
All Superinterfaces:
Serializable
All Known Subinterfaces:
EntryFilter<K,V>, IndexAwareFilter<K,V>, QueryRecorderFilter<T>
All Known Implementing Classes:
AbstractQueryRecorderFilter, AllFilter, AlwaysFilter, AndFilter, AnyFilter, ArrayFilter, BetweenFilter, CacheEventFilter, ClassFilter, ComparisonFilter, ContainsAllFilter, ContainsAnyFilter, ContainsFilter, EqualsFilter, ExtractorFilter, GreaterEqualsFilter, GreaterFilter, InetAddressHelper.RoutableFilter, InetAddressHelper.SubnetMaskFilter, InFilter, InKeySetFilter, IsNotNullFilter, IsNullFilter, KeyAssociatedFilter, KeyFilter, LessEqualsFilter, LessFilter, LikeFilter, LimitFilter, LocalCacheAsynchronousMapListener.NonSyntheticEntryFilter, MapEventFilter, MapEventTransformerFilter, NeverFilter, NonSyntheticEntryFilter, NotEqualsFilter, NotFilter, NullFilter, ObjectNameExcludeFilter, OrFilter, PartitionedCacheAsynchronousMapListener.NonSyntheticEntryFilter, PartitionedCacheSyntheticDeleteMapListener.JCacheExpiryEntryFilter, PartitionedFilter, PassThroughFilterAdapter, PredicateFilter, PresentFilter, PriorityFilter, RegexFilter, ScriptFilter, SimpleAssignmentStrategy.AnalysisContext.NotOwnedFilter, SimpleAssignmentStrategy.AnalysisContext.SafetyFilter, SimpleAssignmentStrategy.AnalysisContext.UnderloadedFilter, SimpleOverflowMap.FrontFilterConverter, ValueChangeEventFilter, WrapperQueryRecorderFilter, XorFilter
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface Filter<T> extends Serializable
Provide for "pluggable" conditional behavior.
Since:
1.0
Author:
cp 1997.09.05, as 2014.06.15
  • Method Summary

    Modifier and Type
    Method
    Description
    default Filter
    and(Filter other)
    Return a composed filter that represents a short-circuiting logical AND of this filter and another.
    default LimitFilter<T>
    asLimitFilter(int cPageSize)
    Return a limit filter based on this filter.
    default <K> KeyAssociatedFilter<T>
    Return a key associated filter based on this filter and a specified key.
    boolean
    Apply the test to the input argument.
    default <K> InKeySetFilter<T>
    forKeys(Set<K> setKeys)
    Return a filter that will only be evaluated within specified key set.
    Return a partitioned filter for a specified partition set.
    default Filter
    or(Filter other)
    Return a composed predicate that represents a short-circuiting logical OR of this predicate and another.
    default Filter
    xor(Filter other)
    Return a composed predicate that represents a logical XOR of this predicate and another.
  • Method Details

    • evaluate

      boolean evaluate(T o)
      Apply the test to the input argument.
      Parameters:
      o - the input argument to evaluate
      Returns:
      true if the input argument matches the filter, otherwise false
    • and

      default Filter and(Filter other)
      Return a composed filter that represents a short-circuiting logical AND of this filter and another. When evaluating the composed filter, if this filter is false, then the other filter is not evaluated.

      Any exceptions thrown during evaluation of either filter are relayed to the caller; if evaluation of this filter throws an exception, the other filter will not be evaluated.

      Parameters:
      other - a filter that will be logically-ANDed with this filter
      Returns:
      a composed filter that represents the short-circuiting logical AND of this filter and the other filter
    • or

      default Filter or(Filter other)
      Return a composed predicate that represents a short-circuiting logical OR of this predicate and another. When evaluating the composed predicate, if this predicate is true, then the other predicate is not evaluated.

      Any exceptions thrown during evaluation of either predicate are relayed to the caller; if evaluation of this predicate throws an exception, the other predicate will not be evaluated.

      Parameters:
      other - a predicate that will be logically-ORed with this predicate
      Returns:
      a composed predicate that represents the short-circuiting logical OR of this predicate and the other predicate
    • xor

      default Filter xor(Filter other)
      Return a composed predicate that represents a logical XOR of this predicate and another.

      Any exceptions thrown during evaluation of either predicate are relayed to the caller; if evaluation of this predicate throws an exception, the other predicate will not be evaluated.

      Parameters:
      other - a predicate that will be logically-XORed with this predicate
      Returns:
      a composed predicate that represents the logical XOR of this predicate and the other predicate
    • associatedWith

      default <K> KeyAssociatedFilter<T> associatedWith(K key)
      Return a key associated filter based on this filter and a specified key.
      Type Parameters:
      K - the key type
      Parameters:
      key - associated key
      Returns:
      a key associated filter
    • forPartitions

      default PartitionedFilter<T> forPartitions(PartitionSet partitions)
      Return a partitioned filter for a specified partition set.
      Parameters:
      partitions - the set of partitions the filter should run against
      Returns:
      a partitioned filter
    • forKeys

      default <K> InKeySetFilter<T> forKeys(Set<K> setKeys)
      Return a filter that will only be evaluated within specified key set.
      Type Parameters:
      K - the key type
      Parameters:
      setKeys - the set of keys to limit the filter evaluation to
      Returns:
      a key set-limited filter
    • asLimitFilter

      default LimitFilter<T> asLimitFilter(int cPageSize)
      Return a limit filter based on this filter.
      Parameters:
      cPageSize - the number of entries per page
      Returns:
      a limit filter