Interface Collector<T,A,R>
public interface Collector<T,A,R>
How
Stream.collect(Collector) folds the elements of a stream into a
result: a container to start from, a step per element, a way to merge two
containers and a last step that turns the container into the result.-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic enumWhat a collector says about itself. -
Method Summary
Modifier and TypeMethodDescriptionBiConsumer<A, T> combiner()finisher()static <T,A, R> Collector <T, A, R> of(Supplier<A> supplier, BiConsumer<A, T> accumulator, BinaryOperator<A> combiner, Function<A, R> finisher, Collector.Characteristics... characteristics) static <T,R> Collector <T, R, R> of(Supplier<R> supplier, BiConsumer<R, T> accumulator, BinaryOperator<R> combiner, Collector.Characteristics... characteristics) supplier()
-
Method Details
-
supplier
-
accumulator
BiConsumer<A,T> accumulator() -
combiner
BinaryOperator<A> combiner() -
finisher
-
characteristics
Set<Collector.Characteristics> characteristics() -
of
static <T,R> Collector<T,R, ofR> (Supplier<R> supplier, BiConsumer<R, T> accumulator, BinaryOperator<R> combiner, Collector.Characteristics... characteristics) -
of
static <T,A, Collector<T,R> A, ofR> (Supplier<A> supplier, BiConsumer<A, T> accumulator, BinaryOperator<A> combiner, Function<A, R> finisher, Collector.Characteristics... characteristics)
-