Client and backend. This class is shared: the same code is compiled into your app and into your server, so everything on this page works in both.
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 types
enum Collector.Characteristics | What a collector says about itself. |
Methods
Method details
supplier
public abstract Supplier<A> supplier()accumulator
public abstract BiConsumer<A, T> accumulator()combiner
public abstract BinaryOperator<A> combiner()finisher
public abstract Function<A, R> finisher()characteristics
public abstract Set<Collector.Characteristics> characteristics()of
public static <T, R> Collector<T, R, R> of(Supplier<R> supplier, BiConsumer<R, T> accumulator, BinaryOperator<R> combiner, Collector.Characteristics... characteristics)of
public 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)