Top Description Fields Constructors Methods
org.jooq.impl

pack-priv final Class DelayedArrayCollector<R extends org.jooq.Record, E>

extends Object
implements Collector<R extends Record, List<E>, E[]>
Class Inheritance
All Implemented Interfaces
java.util.stream.Collector
Static Imports
java.util.Collections.emptySet

An array collector that delays the instantiation of the array type until it is known.

Records#intoArray(Object[]) and similar collectors require an eager specification of the resulting array type. In some cases, this array type cannot be known until a query is executed (e.g in the case of a plain SQL ResultQuery). In that case, we rely ResultQuery#collect(Collector) to inject a Fields implementation prior to running a collection.

Author
Lukas Eder

Field Summary

Modifier and TypeField and Description
private final Function<Fields, E[]>
private final Collector<R, List<E>, List<E>>
pack-priv Fields

Constructor Summary

AccessConstructor and Description
pack-priv
DelayedArrayCollector(Function<Fields, E[]> array, Function<R, E> mapper)

Method Summary

Modifier and TypeMethod and Description
public final BiConsumer<List<E>, R>
accumulator()

Implements java.util.stream.Collector.accumulator.

A function that folds a value into a mutable result container.
public final Set<Collector.Characteristics>
characteristics()

Implements java.util.stream.Collector.characteristics.

Returns a Set of Collector.Characteristics indicating the characteristics of this Collector.
public final BinaryOperator<List<E>>
combiner()

Implements java.util.stream.Collector.combiner.

A function that accepts two partial results and merges them.
public final Function<List<E>, E[]>
finisher()

Implements java.util.stream.Collector.finisher.

Perform the final transformation from the intermediate accumulation type A to the final result type R.
pack-priv static final <F extends Fields> F
patch(Collector<?, ?, ?> collector, F fields)

public final Supplier<List<E>>
supplier()

Implements java.util.stream.Collector.supplier.

A function that creates and returns a new mutable result container.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

arrayback to summary
private final Function<Fields, E[]> array
delegateback to summary
private final Collector<R, List<E>, List<E>> delegate
fieldsback to summary
pack-priv Fields fields

Constructor Detail

DelayedArrayCollectorback to summary
pack-priv DelayedArrayCollector(Function<Fields, E[]> array, Function<R, E> mapper)
Annotations
@SuppressWarnings:unchecked

Method Detail

accumulatorback to summary
public final BiConsumer<List<E>, R> accumulator()

Implements java.util.stream.Collector.accumulator.

Doc from java.util.stream.Collector.accumulator.

A function that folds a value into a mutable result container.

Returns:BiConsumer<List<E>, R>

a function which folds a value into a mutable result container

Annotations
@Override
characteristicsback to summary
public final Set<Collector.Characteristics> characteristics()

Implements java.util.stream.Collector.characteristics.

Doc from java.util.stream.Collector.characteristics.

Returns a Set of Collector.Characteristics indicating the characteristics of this Collector. This set should be immutable.

Returns:Set<Collector.Characteristics>

an immutable set of collector characteristics

Annotations
@Override
combinerback to summary
public final BinaryOperator<List<E>> combiner()

Implements java.util.stream.Collector.combiner.

Doc from java.util.stream.Collector.combiner.

A function that accepts two partial results and merges them. The combiner function may fold state from one argument into the other and return that, or may return a new result container.

Returns:BinaryOperator<List<E>>

a function which combines two partial results into a combined result

Annotations
@Override
finisherback to summary
public final Function<List<E>, E[]> finisher()

Implements java.util.stream.Collector.finisher.

Doc from java.util.stream.Collector.finisher.

Perform the final transformation from the intermediate accumulation type A to the final result type R.

If the characteristic IDENTITY_FINISH is set, this function may be presumed to be an identity transform with an unchecked cast from A to R.

Returns:Function<List<E>, E[]>

a function which transforms the intermediate result to the final result

Annotations
@Override
patchback to summary
pack-priv static final <F extends Fields> F patch(Collector<?, ?, ?> collector, F fields)
supplierback to summary
public final Supplier<List<E>> supplier()

Implements java.util.stream.Collector.supplier.

Doc from java.util.stream.Collector.supplier.

A function that creates and returns a new mutable result container.

Returns:Supplier<List<E>>

a function which returns a new, mutable result container

Annotations
@Override