Class AndFilter
java.lang.Object
com.invirgance.convirgance.transform.filter.AndFilter
- All Implemented Interfaces:
Filter,Transformer,Predicate<JSONObject>
Filters JSONObjects based on multiple criteria, requiring all conditions to be met.
Combines multiple filters, returning true only if every filter evaluates the
given record as true.
- Author:
- jbanes
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the current filters that form the criteria.voidsetFilters(List<Filter> filters) Sets the filters used to form the criteria.booleantest(JSONObject record) Evaluates the given record against all the filters.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.invirgance.convirgance.transform.Transformer
transform
-
Constructor Details
-
AndFilter
public AndFilter()Creates an empty AndFilter. -
AndFilter
Creates a AndFilter with the list of filters that need to pass during evaluation.- Parameters:
filters- List of filters to use.
-
AndFilter
Creates a AndFilter with the list of filters that need to pass during evaluation.- Parameters:
filters- List of filters to use.
-
-
Method Details
-
getFilters
Returns the current filters that form the criteria.- Returns:
- The filters.
-
setFilters
Sets the filters used to form the criteria.- Parameters:
filters- The filters.
-
test
Evaluates the given record against all the filters.- Specified by:
testin interfaceFilter- Specified by:
testin interfacePredicate<JSONObject>- Parameters:
record- The record to evaluate.- Returns:
- True if the record meets all the criteria defined by the filters, false if it fails any of them.
-