Class Predicates


  • public final class Predicates
    extends Object
    Predicate helpers, inspired by http://minborgsjavapot.blogspot.it/2016/03/put-your-java-8-method-references-to.html
    • Method Detail

      • of

        public static <T> Predicate<T> of​(Predicate<T> predicate)
        Wrap a predicate, useful for method references.
      • negate

        public static <T> Predicate<T> negate​(Predicate<T> predicate)
        Negates a predicate, useful for method references.
         Stream.of("A", "", "B")
                 .filter(Predicates.negate(String::isEmpty))
                 .count();