jOOL icon indicating copy to clipboard operation
jOOL copied to clipboard

Pass appropriate java.util.stream.Collector.Characteristics to Collector API

Open lukaseder opened this issue 9 years ago • 2 comments

java.util.stream.Stream can implement some optimisations if custom Collectors pass hints to the collect() API via java.util.stream.Collector.Characteristics. We should also pass these characteristics.

lukaseder avatar Mar 13 '16 14:03 lukaseder

As you mostly ignore parallel streams, the only useful characteristic in your case is IDENTITY_FINISH which is automatically injected if you are using Collector.of without providing the finisher.

amaembo avatar Mar 13 '16 15:03 amaembo

Thanks for the feedback, @amaembo. Within jOOλ, that's certainly true, but people might use the collectors exposed in Agg also for parallel JDK streams, or for StreamEx...

lukaseder avatar Mar 13 '16 15:03 lukaseder