java.lang.Object
com.invirgance.convirgance.transform.filter.AndFilter
All Implemented Interfaces:
Filter, Transformer, Predicate<JSONObject>

@Wiring public class AndFilter extends Object implements Filter
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 Details

    • AndFilter

      public AndFilter()
      Creates an empty AndFilter.
    • AndFilter

      public AndFilter(List<Filter> filters)
      Creates a AndFilter with the list of filters that need to pass during evaluation.
      Parameters:
      filters - List of filters to use.
    • AndFilter

      public AndFilter(Filter... filters)
      Creates a AndFilter with the list of filters that need to pass during evaluation.
      Parameters:
      filters - List of filters to use.
  • Method Details

    • getFilters

      public List<Filter> getFilters()
      Returns the current filters that form the criteria.
      Returns:
      The filters.
    • setFilters

      public void setFilters(List<Filter> filters)
      Sets the filters used to form the criteria.
      Parameters:
      filters - The filters.
    • test

      public boolean test(JSONObject record)
      Evaluates the given record against all the filters.
      Specified by:
      test in interface Filter
      Specified by:
      test in interface Predicate<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.