Class PredicateUtil


  • public final class PredicateUtil
    extends java.lang.Object
    Utilities used in context of java Predicate.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static <T> java.util.function.Predicate<T> not​(java.util.function.Predicate<T> predicate)
      Negates the given predicate.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • not

        public static <T> java.util.function.Predicate<T> not​(java.util.function.Predicate<T> predicate)
        Negates the given predicate. This can be used in streams when casting the method reference to a predicate is not really legible.
        Type Parameters:
        T - the type of the predicate
        Parameters:
        predicate - the predicate to be negated
        Returns:
        the negated predicate or null if the given predicate was null