-
Enhancement
-
Resolution: Fixed
-
P4
-
None
-
None
-
b13
Add a new Collector into Collectors class which merges results of two other collectors. One API method should be added (name is subject to discussion):
public static <T, R1, R2, R>
Collector<T, ?, R> teeing(Collector<? super T, ?, R1> c1,
Collector<? super T, ?, R2> c2,
BiFunction<? super R1, ? super R2, ? extends R> finisher);
Every stream element should be passed to both collectors c1 and c2. To compute a final result, a finisher function is called which combines the results of two individual collectors.
public static <T, R1, R2, R>
Collector<T, ?, R> teeing(Collector<? super T, ?, R1> c1,
Collector<? super T, ?, R2> c2,
BiFunction<? super R1, ? super R2, ? extends R> finisher);
Every stream element should be passed to both collectors c1 and c2. To compute a final result, a finisher function is called which combines the results of two individual collectors.
- csr for
-
JDK-8209685 Create Collector which merges results of two other collectors
- Closed