Skip to content
Buy me a coffee

Collector

Collector: object

Defined in: src/stream/Collectors.ts:27

Factory and characteristic constants for Collector.

Characteristics: object

The characteristic names as constants; the same strings as CollectorCharacteristics.

readonly CONCURRENT: "CONCURRENT" = 'CONCURRENT'

One container may be fed concurrently; no effect on the single JS thread.

readonly IDENTITY_FINISH: "IDENTITY_FINISH" = 'IDENTITY_FINISH'

The finisher is the identity: the container is the result and the finisher is skipped.

readonly UNORDERED: "UNORDERED" = 'UNORDERED'

The result does not depend on encounter order.

of: {<T, R>(supplier, accumulator, combiner, …characteristics): Collector<T, R, R>; <T, A, R>(supplier, accumulator, combiner, finisher, …characteristics): Collector<T, A, R>; }

Collector from functions. Without a finisher the result is the container and IDENTITY_FINISH is always reported; with one, exactly the given characteristics are reported.

<T, R>(supplier, accumulator, combiner, …characteristics): Collector<T, R, R>

A collector whose container is the result: IDENTITY_FINISH is always reported, plus the given characteristics.

T

R

() => R

(r, t) => void

(a, b) => R

…CollectorCharacteristics[]

Collector<T, R, R>

<T, A, R>(supplier, accumulator, combiner, finisher, …characteristics): Collector<T, A, R>

A collector with a finisher; exactly the given characteristics are reported.

T

A

R

() => A

(a, t) => void

(a, b) => A

(a) => R

…CollectorCharacteristics[]

Collector<T, A, R>

NullPointerException if any function or characteristic is null