Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8272497

Lack of Int-/Long-/Double-/BiPredicate.not()

    XMLWordPrintable

    Details

    • Type: Enhancement
    • Status: New
    • Priority: P4
    • Resolution: Unresolved
    • Affects Version/s: 16
    • Fix Version/s: None
    • Component/s: core-libs
    • 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)?


        Attachments

          Activity

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated: