DATATYPE - The type of object to filter.@NotThreadSafe public abstract class AbstractFilter<DATATYPE> extends Object implements IFilter<DATATYPE>, IPredicate<DATATYPE>
IFilter that has an optional nested
filter.| Constructor and Description |
|---|
AbstractFilter()
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object o) |
EFilterMatchingStrategy |
getMatchingStrategy() |
IFilter<? super DATATYPE> |
getNestedFilter() |
int |
hashCode() |
boolean |
matchesFilter(DATATYPE aValue)
Check if the given value matches the filter or not.
|
abstract boolean |
matchesThisFilter(DATATYPE aValue)
This is the method to be implemented to match this filter.
|
AbstractFilter<DATATYPE> |
setMatchingStrategy(EFilterMatchingStrategy eMatchingStrategy)
Set the filter matching strategy.
|
AbstractFilter<DATATYPE> |
setNestedFilter(IFilter<? super DATATYPE> aNestedFilter)
Set the nested filter to be invoked if it matches this filter.
|
boolean |
test(DATATYPE aValue)
Evaluates this predicate on the given argument.
|
String |
toString() |
@Nonnull public final EFilterMatchingStrategy getMatchingStrategy()
null. By default the "match any" strategy is used.@Nonnull public final AbstractFilter<DATATYPE> setMatchingStrategy(@Nonnull EFilterMatchingStrategy eMatchingStrategy)
eMatchingStrategy - The matching strategy to be used. May not be null.@Nullable public final IFilter<? super DATATYPE> getNestedFilter()
null.@Nonnull public final AbstractFilter<DATATYPE> setNestedFilter(@Nullable IFilter<? super DATATYPE> aNestedFilter)
aNestedFilter - The nested filter to use. May be null to not have a
nested filter-public abstract boolean matchesThisFilter(DATATYPE aValue)
aValue - The value to be matchedtrue if the value matches the filterpublic final boolean test(DATATYPE aValue)
IPredicatetest in interface IPredicate<DATATYPE>aValue - the input argumenttrue if the input argument matches the predicate, otherwise
falsepublic final boolean matchesFilter(DATATYPE aValue)
IFiltermatchesFilter in interface IFilter<DATATYPE>aValue - The object to filter. May be null depending on the
implementation.true if the object match the filter,
false otherwise.Copyright © 2014–2015 Philip Helger. All rights reserved.