RFR: 8272137: Make Collection and Optional classes streamable

CC007 github.com+5381337+cc007 at openjdk.java.net
Wed Sep 1 17:30:17 UTC 2021


On Mon, 9 Aug 2021 12:28:23 GMT, CC007 <github.com+5381337+CC007 at openjdk.org> wrote:

> create Streamable and ParallelStreamable interface and use them in Collection and Optional

> _Mailing list message from [Alan Snyder](mailto:javalists at cbfiddle.com) on [core-libs-dev](mailto:core-libs-dev at mail.openjdk.java.net):_
> 
> Ah, if only one could define a type alias Streamable<T> = Supplier<Stream<T>>...

If you use that, you'd lose some semantics that the method name would have given you. I feel that @liach 's solution is cleaner, since that preserves this method name.

-------------

PR: https://git.openjdk.java.net/jdk/pull/5050


More information about the core-libs-dev mailing list