Class AllOf<T>

Type Parameters:
T - the type of object this condition accepts.
All Implemented Interfaces:
Descriptable<Condition<T>>

public class AllOf<T> extends Join<T>
Returns true if all of the joined conditions are satisfied.
Author:
Yvonne Wang, Mikhail Mazursky
  • Method Details

    • allOf

      @SafeVarargs public static <T> Condition<T> allOf(Condition<? super T>... conditions)
      Creates a new AllOf
      Type Parameters:
      T - the type of object the given condition accept.
      Parameters:
      conditions - the conditions to evaluate.
      Returns:
      the created AllOf.
      Throws:
      NullPointerException - if the given array is null.
      NullPointerException - if any of the elements in the given array is null.
    • allOf

      public static <T> Condition<T> allOf(Iterable<? extends Condition<? super T>> conditions)
      Creates a new AllOf
      Type Parameters:
      T - the type of object the given condition accept.
      Parameters:
      conditions - the conditions to evaluate.
      Returns:
      the created AllOf.
      Throws:
      NullPointerException - if the given iterable is null.
      NullPointerException - if any of the elements in the given iterable is null.
    • matches

      public boolean matches(T value)
      Verifies that the given value satisfies this condition.
      Overrides:
      matches in class Condition<T>
      Parameters:
      value - the value to verify.
      Returns:
      true if the given value satisfies this condition; false otherwise.
    • descriptionPrefix

      public String descriptionPrefix()
      Description copied from class: Join
      method used to prefix the subclass join description, ex: "all of"
      Specified by:
      descriptionPrefix in class Join<T>
      Returns:
      the prefix to use to build the description.