amaembo / streamex

Enhancing Java Stream API
Apache License 2.0
2.18k stars 249 forks source link

mapMulti #269

Closed mmariotti closed 10 months ago

mmariotti commented 10 months ago

Hello Tagir,

image

As you can see, the .toSet() gives a compilation error, because StreamEx does not override Stream#mapMulti which is a default method.

Is it possible to override to return a StreamEx instead of a normal Stream? If it's not possible (maybe for compatibility), is it possible to workaround it?

Thanks!

amaembo commented 10 months ago

Hello!

I'll try to do this for object stream. Unfortunately, it's hard to do this for primitive streams (IntStreamEx, etc.), as their mapMulti methods refer to the new functional interface, which is not available in previous Java versions.