Class NotPredicate<T>

    • Constructor Summary

      Constructors 
      Constructor Description
      NotPredicate​(Predicate<? super T> predicate)
      Constructor that performs no validation.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      Predicate<? super T>[] getPredicates()
      Gets the predicate being decorated.
      static <T> Predicate<T> notPredicate​(Predicate<? super T> predicate)
      Creates the not predicate.
      boolean test​(T object)
      Evaluates the predicate returning the opposite to the stored predicate.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface java.util.function.Predicate

        and, negate, or
    • Constructor Detail

      • NotPredicate

        public NotPredicate​(Predicate<? super T> predicate)
        Constructor that performs no validation. Use notPredicate if you want that.
        Parameters:
        predicate - the predicate to call after the null check
    • Method Detail

      • notPredicate

        public static <T> Predicate<T> notPredicate​(Predicate<? super T> predicate)
        Creates the not predicate.
        Type Parameters:
        T - the type that the predicate queries
        Parameters:
        predicate - the predicate to decorate, not null
        Returns:
        the predicate
        Throws:
        java.lang.NullPointerException - if the predicate is null
      • test

        public boolean test​(T object)
        Evaluates the predicate returning the opposite to the stored predicate.
        Specified by:
        test in interface java.util.function.Predicate<T>
        Specified by:
        test in interface Predicate<T>
        Parameters:
        object - the input object
        Returns:
        true if predicate returns false