Class PredicateUtils

java.lang.Object
org.codice.ddf.test.common.function.PredicateUtils

public class PredicateUtils extends Object
This class provides utilities for working with predicates.
  • Method Details

    • allOf

      public static <T> Predicate<T> allOf(Predicate<T>... predicates)
      Returns a new predicate that will report true if all provided predicates report true for the tested argument.
      Type Parameters:
      T - the type of object being tested
      Parameters:
      predicates - the set of predicates to test with
      Returns:
      a new predicate that expects all given predicates to return true for the tested argument in order to return true
    • anyOf

      public static <T> Predicate<T> anyOf(Predicate<T>... predicates)
      Returns a new predicate that will report true if any of the provided predicates report true for the tested argument.
      Type Parameters:
      T - the type of object being tested
      Parameters:
      predicates - the set of predicates to test with
      Returns:
      a new predicate that expects any given predicates to return true for the tested argument in order to return true