Package com.tangosol.util
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
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default Filterand(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>associatedWith(K key)Return a key associated filter based on this filter and a specified key.booleanevaluate(T o)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.default PartitionedFilter<T>forPartitions(PartitionSet partitions)Return a partitioned filter for a specified partition set.default Filteror(Filter other)Return a composed predicate that represents a short-circuiting logical OR of this predicate and another.default StringtoExpression()Return a string expression for this filter.default Filterxor(Filter other)Return a composed predicate that represents a logical XOR of this predicate and another.
-
-
-
Method Detail
-
evaluate
boolean evaluate(T o)
Apply the test to the input argument.- Parameters:
o- the input argument to evaluate- Returns:
trueif the input argument matches the filter, otherwisefalse
-
toExpression
default String toExpression()
Return a string expression for this filter.- Returns:
- a string expression for this filter
-
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 isfalse, then theotherfilter 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
otherfilter 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
otherfilter
-
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 istrue, then theotherpredicate 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
otherpredicate 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
otherpredicate
-
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
otherpredicate 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
otherpredicate
-
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
-
-