src/java.base/share/classes/java/util/function/Predicate.java
changeset 50310 5a9acf84c34a
parent 47216 71c04702a3d5
child 50567 9ee93487d262
equal deleted inserted replaced
50309:37ebfe8bac7f 50310:5a9acf84c34a
   114     static <T> Predicate<T> isEqual(Object targetRef) {
   114     static <T> Predicate<T> isEqual(Object targetRef) {
   115         return (null == targetRef)
   115         return (null == targetRef)
   116                 ? Objects::isNull
   116                 ? Objects::isNull
   117                 : object -> targetRef.equals(object);
   117                 : object -> targetRef.equals(object);
   118     }
   118     }
       
   119 
       
   120     /**
       
   121      * Returns a predicate that is the negation of the supplied predicate.
       
   122      *
       
   123      * @param <T>     the type of arguments to the specified predicate
       
   124      * @param target  predicate to negate
       
   125      *
       
   126      * @return a predicate that negates the results of the supplied
       
   127      *         predicate
       
   128      *
       
   129      * @since 11
       
   130      */
       
   131     @SuppressWarnings("unchecked")
       
   132     static <T> Predicate<T> not(Predicate<? super T> target) {
       
   133         return (Predicate<T>)target.negate();
       
   134     }
   119 }
   135 }