-
Enhancement
-
Resolution: Duplicate
-
P4
-
None
-
None
-
generic
-
generic
A DESCRIPTION OF THE PROBLEM :
Predicate has a static method not that is useful in stream.filter(...) (as described in https://bugs.openjdk.java.net/browse/JDK-8203428) but there are no corresponding methods for the XxxPredicate classes.
Off topic: I know big changes shouldn't be proposed here, but I've got a not entirely serious one anyway. What about allowing unary operators on predicates/functions like intStream.filter(!Character::isAlphabetic)? And alone like intStream.map(-)? Or even binary ones in some forms like intStream.map(*2), intStream.map(/2), intStream.map(1000/), intStream.filter(%10==7), intStream.filter(Util::odd&&Util::negative), intStream.filter(<5) and intStream.map(someIntUnaryOperator*2)?
Predicate has a static method not that is useful in stream.filter(...) (as described in https://bugs.openjdk.java.net/browse/JDK-8203428) but there are no corresponding methods for the XxxPredicate classes.
Off topic: I know big changes shouldn't be proposed here, but I've got a not entirely serious one anyway. What about allowing unary operators on predicates/functions like intStream.filter(!Character::isAlphabetic)? And alone like intStream.map(-)? Or even binary ones in some forms like intStream.map(*2), intStream.map(/2), intStream.map(1000/), intStream.filter(%10==7), intStream.filter(Util::odd&&Util::negative), intStream.filter(<5) and intStream.map(someIntUnaryOperator*2)?
- duplicates
-
JDK-8253396 Please add `not()` method to `java.util.function.BiPredicate`
-
- New
-