spotify / completable-futures

Utilities for working with futures in Java 8
Apache License 2.0
393 stars 51 forks source link

Added CompletableFutures.joinMap #78

Closed npiguet closed 3 years ago

npiguet commented 3 years ago

Adds CompletableFutures.joinMap().

joinMap() is to allAsMap() as joinList() is to allAsList(): a stream collector that does the same operation without forcing the user to use a temporary variable. This is especially useful since Map declarations with both key and value type are considerably more visually cluttered than List declarations.

npiguet commented 3 years ago

I just noticed there was another PR (#57) for the same thing, which was closed with the comment:

Now that we have allAsMap (#70) I'll close this. If we want a collector version of it, we can add that as another PR

... I guess this is the one.

npiguet commented 3 years ago

I've fixed the source of the nit comments.

dflemstr commented 3 years ago

OK, now this LGTM!