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 is satisfied.
    Author:
    Yvonne Wang, Mikhail Mazursky
    • Method Detail

      • allOf

        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 AnyOf.
        Throws:
        java.lang.NullPointerException - if the given array is null.
        java.lang.NullPointerException - if any of the elements in the given array is null.
      • allOf

        public static <T> Condition<T> allOf​(java.lang.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 AnyOf.
        Throws:
        java.lang.NullPointerException - if the given iterable is null.
        java.lang.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.
        Specified by:
        matches in class Condition<T>
        Parameters:
        value - the value to verify.
        Returns:
        true if the given value satisfies this condition; false otherwise.
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class Condition<T>