Details
-
Type:
Enhancement
-
Status: New
-
Priority:
P4
-
Resolution: Unresolved
-
Affects Version/s: 16
-
Fix Version/s: None
-
Component/s: core-libs
-
Labels:
-
Subcomponent:
-
CPU:generic
-
OS:generic
Description
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)?