enhance Stream.distinct() to allow customization of what is considered "distinct"

XMLWordPrintable

    • Type: Enhancement
    • Resolution: Unresolved
    • Priority: P3
    • tbd
    • Affects Version/s: None
    • Component/s: core-libs

      Currently Stream.distinct() keeps seen values in a Set which implicitly compares them for equality. It would be nice for the application to supply some other notion of equality than the object's built-in notion. This could be phrased as passing a Predicate<T,T> that is used to determine equality between two values of type T. An alternative would be to pass a Function<T,U> that maps each value into a different value that is then stored in the set and is tested for equality.

            Assignee:
            Stuart Marks
            Reporter:
            Stuart Marks
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: