Top Description Methods
org.jooq.lambda

public Interface Collectable<T>

Known Direct Subinterfaces
org.jooq.lambda.Seq, org.jooq.lambda.Window
Imports
java.util.ArrayList, .Collection, .Comparator, .LinkedHashSet, .List, .Map, .Optional, .Set, java.util.function.Function, .Predicate, .Supplier, .ToDoubleFunction, .ToIntFunction, .ToLongFunction, java.util.stream.Collector, .Collectors, .Stream, org.jooq.lambda.tuple.Tuple, .Tuple10, .Tuple11, .Tuple12, .Tuple13, .Tuple14, .Tuple15, .Tuple16, .Tuple2, .Tuple3, .Tuple4, .Tuple5, .Tuple6, .Tuple7, .Tuple8, .Tuple9

A common super type for types like Seq or Window delegating common aggregation functions to collect(Collector)
Author
Lukas Eder

Method Summary

Modifier and TypeMethod and Description
public boolean
allMatch(Predicate<? super T> predicate)

Whether all elements in the collectable match a given predicate.

public boolean
anyMatch(Predicate<? super T> predicate)

Whether any element in the collectable matches a given predicate.

public Optional<T>
avg()

Get the average of the elements in this collectable.

public <U> Optional<U>
avg(Function<? super T, ? extends U> function)

Get the average of the elements in this collectable.

public double
avgDouble(ToDoubleFunction<? super T> function)

Get the average of the elements in this collectable as double.

public double
avgInt(ToIntFunction<? super T> function)

Get the average of the elements in this collectable as int.

public double
avgLong(ToLongFunction<? super T> function)

Get the average of the elements in this collectable as long.

public Optional<T>
bitAnd()

Collect all bits in this stream into a single value by applying bitwise and.

public <U> Optional<U>
bitAnd(Function<? super T, ? extends U> function)

Collect all bits in this stream into a single value by applying bitwise and.

public int
bitAndInt(ToIntFunction<? super T> function)

Collect all bits in this stream into a single value by applying bitwise and.

public long
bitAndLong(ToLongFunction<? super T> function)

Collect all bits in this stream into a single value by applying bitwise and.

public Optional<T>
bitOr()

Collect all bits in this stream into a single value by applying bitwise or.

public <U> Optional<U>
bitOr(Function<? super T, ? extends U> function)

Collect all bits in this stream into a single value by applying bitwise or.

public int
bitOrInt(ToIntFunction<? super T> function)

Collect all bits in this stream into a single value by applying bitwise or.

public long
bitOrLong(ToLongFunction<? super T> function)

Collect all bits in this stream into a single value by applying bitwise or.

public <R, A> R
collect(Collector<? super T, A, R> collector)

Collect this collectable.

public default <R1, R2, A1, A2> Tuple2<R1, R2>
collect(Collector<? super T, A1, R1> collector1, Collector<? super T, A2, R2> collector2)

public default <R1, R2, R3, A1, A2, A3> Tuple3<R1, R2, R3>
collect(Collector<? super T, A1, R1> collector1, Collector<? super T, A2, R2> collector2, Collector<? super T, A3, R3> collector3)

public default <R1, R2, R3, R4, A1, A2, A3, A4> Tuple4<R1, R2, R3, R4>
collect(Collector<? super T, A1, R1> collector1, Collector<? super T, A2, R2> collector2, Collector<? super T, A3, R3> collector3, Collector<? super T, A4, R4> collector4)

public default <R1, R2, R3, R4, R5, A1, A2, A3, A4, A5> Tuple5<R1, R2, R3, R4, R5>
collect(Collector<? super T, A1, R1> collector1, Collector<? super T, A2, R2> collector2, Collector<? super T, A3, R3> collector3, Collector<? super T, A4, R4> collector4, Collector<? super T, A5, R5> collector5)

public default <R1, R2, R3, R4, R5, R6, A1, A2, A3, A4, A5, A6> Tuple6<R1, R2, R3, R4, R5, R6>
collect(Collector<? super T, A1, R1> collector1, Collector<? super T, A2, R2> collector2, Collector<? super T, A3, R3> collector3, Collector<? super T, A4, R4> collector4, Collector<? super T, A5, R5> collector5, Collector<? super T, A6, R6> collector6)

public default <R1, R2, R3, R4, R5, R6, R7, A1, A2, A3, A4, A5, A6, A7> Tuple7<R1, R2, R3, R4, R5, R6, R7>
collect(Collector<? super T, A1, R1> collector1, Collector<? super T, A2, R2> collector2, Collector<? super T, A3, R3> collector3, Collector<? super T, A4, R4> collector4, Collector<? super T, A5, R5> collector5, Collector<? super T, A6, R6> collector6, Collector<? super T, A7, R7> collector7)

public default <R1, R2, R3, R4, R5, R6, R7, R8, A1, A2, A3, A4, A5, A6, A7, A8> Tuple8<R1, R2, R3, R4, R5, R6, R7, R8>
collect(Collector<? super T, A1, R1> collector1, Collector<? super T, A2, R2> collector2, Collector<? super T, A3, R3> collector3, Collector<? super T, A4, R4> collector4, Collector<? super T, A5, R5> collector5, Collector<? super T, A6, R6> collector6, Collector<? super T, A7, R7> collector7, Collector<? super T, A8, R8> collector8)

public default <R1, R2, R3, R4, R5, R6, R7, R8, R9, A1, A2, A3, A4, A5, A6, A7, A8, A9> Tuple9<R1, R2, R3, R4, R5, R6, R7, R8, R9>
collect(Collector<? super T, A1, R1> collector1, Collector<? super T, A2, R2> collector2, Collector<? super T, A3, R3> collector3, Collector<? super T, A4, R4> collector4, Collector<? super T, A5, R5> collector5, Collector<? super T, A6, R6> collector6, Collector<? super T, A7, R7> collector7, Collector<? super T, A8, R8> collector8, Collector<? super T, A9, R9> collector9)

public default <R1, R2, R3, R4, R5, R6, R7, R8, R9, R10, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10> Tuple10<R1, R2, R3, R4, R5, R6, R7, R8, R9, R10>
collect(Collector<? super T, A1, R1> collector1, Collector<? super T, A2, R2> collector2, Collector<? super T, A3, R3> collector3, Collector<? super T, A4, R4> collector4, Collector<? super T, A5, R5> collector5, Collector<? super T, A6, R6> collector6, Collector<? super T, A7, R7> collector7, Collector<? super T, A8, R8> collector8, Collector<? super T, A9, R9> collector9, Collector<? super T, A10, R10> collector10)

public default <R1, R2, R3, R4, R5, R6, R7, R8, R9, R10, R11, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11> Tuple11<R1, R2, R3, R4, R5, R6, R7, R8, R9, R10, R11>
collect(Collector<? super T, A1, R1> collector1, Collector<? super T, A2, R2> collector2, Collector<? super T, A3, R3> collector3, Collector<? super T, A4, R4> collector4, Collector<? super T, A5, R5> collector5, Collector<? super T, A6, R6> collector6, Collector<? super T, A7, R7> collector7, Collector<? super T, A8, R8> collector8, Collector<? super T, A9, R9> collector9, Collector<? super T, A10, R10> collector10, Collector<? super T, A11, R11> collector11)

public default <R1, R2, R3, R4, R5, R6, R7, R8, R9, R10, R11, R12, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12> Tuple12<R1, R2, R3, R4, R5, R6, R7, R8, R9, R10, R11, R12>
collect(Collector<? super T, A1, R1> collector1, Collector<? super T, A2, R2> collector2, Collector<? super T, A3, R3> collector3, Collector<? super T, A4, R4> collector4, Collector<? super T, A5, R5> collector5, Collector<? super T, A6, R6> collector6, Collector<? super T, A7, R7> collector7, Collector<? super T, A8, R8> collector8, Collector<? super T, A9, R9> collector9, Collector<? super T, A10, R10> collector10, Collector<? super T, A11, R11> collector11, Collector<? super T, A12, R12> collector12)

public default <R1, R2, R3, R4, R5, R6, R7, R8, R9, R10, R11, R12, R13, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13> Tuple13<R1, R2, R3, R4, R5, R6, R7, R8, R9, R10, R11, R12, R13>
collect(Collector<? super T, A1, R1> collector1, Collector<? super T, A2, R2> collector2, Collector<? super T, A3, R3> collector3, Collector<? super T, A4, R4> collector4, Collector<? super T, A5, R5> collector5, Collector<? super T, A6, R6> collector6, Collector<? super T, A7, R7> collector7, Collector<? super T, A8, R8> collector8, Collector<? super T, A9, R9> collector9, Collector<? super T, A10, R10> collector10, Collector<? super T, A11, R11> collector11, Collector<? super T, A12, R12> collector12, Collector<? super T, A13, R13> collector13)

public default <R1, R2, R3, R4, R5, R6, R7, R8, R9, R10, R11, R12, R13, R14, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14> Tuple14<R1, R2, R3, R4, R5, R6, R7, R8, R9, R10, R11, R12, R13, R14>
collect(Collector<? super T, A1, R1> collector1, Collector<? super T, A2, R2> collector2, Collector<? super T, A3, R3> collector3, Collector<? super T, A4, R4> collector4, Collector<? super T, A5, R5> collector5, Collector<? super T, A6, R6> collector6, Collector<? super T, A7, R7> collector7, Collector<? super T, A8, R8> collector8, Collector<? super T, A9, R9> collector9, Collector<? super T, A10, R10> collector10, Collector<? super T, A11, R11> collector11, Collector<? super T, A12, R12> collector12, Collector<? super T, A13, R13> collector13, Collector<? super T, A14, R14> collector14)

public default <R1, R2, R3, R4, R5, R6, R7, R8, R9, R10, R11, R12, R13, R14, R15, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15> Tuple15<R1, R2, R3, R4, R5, R6, R7, R8, R9, R10, R11, R12, R13, R14, R15>
collect(Collector<? super T, A1, R1> collector1, Collector<? super T, A2, R2> collector2, Collector<? super T, A3, R3> collector3, Collector<? super T, A4, R4> collector4, Collector<? super T, A5, R5> collector5, Collector<? super T, A6, R6> collector6, Collector<? super T, A7, R7> collector7, Collector<? super T, A8, R8> collector8, Collector<? super T, A9, R9> collector9, Collector<? super T, A10, R10> collector10, Collector<? super T, A11, R11> collector11, Collector<? super T, A12, R12> collector12, Collector<? super T, A13, R13> collector13, Collector<? super T, A14, R14> collector14, Collector<? super T, A15, R15> collector15)

public default <R1, R2, R3, R4, R5, R6, R7, R8, R9, R10, R11, R12, R13, R14, R15, R16, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16> Tuple16<R1, R2, R3, R4, R5, R6, R7, R8, R9, R10, R11, R12, R13, R14, R15, R16>
collect(Collector<? super T, A1, R1> collector1, Collector<? super T, A2, R2> collector2, Collector<? super T, A3, R3> collector3, Collector<? super T, A4, R4> collector4, Collector<? super T, A5, R5> collector5, Collector<? super T, A6, R6> collector6, Collector<? super T, A7, R7> collector7, Collector<? super T, A8, R8> collector8, Collector<? super T, A9, R9> collector9, Collector<? super T, A10, R10> collector10, Collector<? super T, A11, R11> collector11, Collector<? super T, A12, R12> collector12, Collector<? super T, A13, R13> collector13, Collector<? super T, A14, R14> collector14, Collector<? super T, A15, R15> collector15, Collector<? super T, A16, R16> collector16)

public String
commonPrefix()

Get the common prefix of all strings (or to-stringed values) in this stream.

public String
commonSuffix()

Get the common prefix of all strings (or to-stringed values) in this stream.

public long
count()

Count the values in this collectable.

public long
count(Predicate<? super T> predicate)

Count the values in this collectable, for which a predicate evaluates to true.

public long
countDistinct()

Count the distinct values in this collectable.

public long
countDistinct(Predicate<? super T> predicate)

Count the distinct values in this collectable, for which a predicate evaluates to true.

public <U> long
countDistinctBy(Function<? super T, ? extends U> function)

Count the distinct values of a given expression in this collectable.

public <U> long
countDistinctBy(Function<? super T, ? extends U> function, Predicate<? super U> predicate)

Count the distinct values of a given expression in this collectable, for which a predicate evaluates to true.

public Optional<T>
max()

Get the maximum value.

public Optional<T>
max(Comparator<? super T> comparator)

Get the maximum value by a function.

public <U extends Comparable<? super U>> Optional<U>
max(Function<? super T, ? extends U> function)

Get the maximum value by a function.

public <U> Optional<U>
max(Function<? super T, ? extends U> function, Comparator<? super U> comparator)

Get the maximum value by a function.

public Seq<T>
maxAll()

Get the maximum values.

public Seq<T>
maxAll(Comparator<? super T> comparator)

Get the maximum values by a function.

public <U extends Comparable<? super U>> Seq<U>
maxAll(Function<? super T, ? extends U> function)

Get the maximum values by a function.

public <U> Seq<U>
maxAll(Function<? super T, ? extends U> function, Comparator<? super U> comparator)

Get the maximum values by a function.

public <U extends Comparable<? super U>> Seq<T>
maxAllBy(Function<? super T, ? extends U> function)

Get the maximum values by a function.

public <U> Seq<T>
maxAllBy(Function<? super T, ? extends U> function, Comparator<? super U> comparator)

Get the maximum values by a function.

public <U extends Comparable<? super U>> Optional<T>
maxBy(Function<? super T, ? extends U> function)

Get the maximum value by a function.

public <U> Optional<T>
maxBy(Function<? super T, ? extends U> function, Comparator<? super U> comparator)

Get the maximum value by a function.

public Optional<T>
median()

Get the median value.

public Optional<T>
median(Comparator<? super T> comparator)

Get the median value.

public <U extends Comparable<? super U>> Optional<T>
medianBy(Function<? super T, ? extends U> function)

Get the median value by a function.

public <U> Optional<T>
medianBy(Function<? super T, ? extends U> function, Comparator<? super U> comparator)

Get the median value by a function.

public Optional<T>
min()

Get the minimum value.

public Optional<T>
min(Comparator<? super T> comparator)

Get the minimum value by a function.

public <U extends Comparable<? super U>> Optional<U>
min(Function<? super T, ? extends U> function)

Get the minimum value by a function.

public <U> Optional<U>
min(Function<? super T, ? extends U> function, Comparator<? super U> comparator)

Get the minimum value by a function.

public Seq<T>
minAll()

Get the minimum values.

public Seq<T>
minAll(Comparator<? super T> comparator)

Get the minimum values by a function.

public <U extends Comparable<? super U>> Seq<U>
minAll(Function<? super T, ? extends U> function)

Get the minimum values by a function.

public <U> Seq<U>
minAll(Function<? super T, ? extends U> function, Comparator<? super U> comparator)

Get the minimum values by a function.

public <U extends Comparable<? super U>> Seq<T>
minAllBy(Function<? super T, ? extends U> function)

Get the minimum values by a function.

public <U> Seq<T>
minAllBy(Function<? super T, ? extends U> function, Comparator<? super U> comparator)

Get the minimum values by a function.

public <U extends Comparable<? super U>> Optional<T>
minBy(Function<? super T, ? extends U> function)

Get the minimum value by a function.

public <U> Optional<T>
minBy(Function<? super T, ? extends U> function, Comparator<? super U> comparator)

Get the minimum value by a function.

public Optional<T>
mode()

Get the mode, i.e. the value that appears most often in the collectable.

public Seq<T>
modeAll()

Get the mode, i.e. the values that appear most often in the collectable.

public <U> Seq<T>
modeAllBy(Function<? super T, ? extends U> function)

Get the mode, i.e. the values that appear most often in the collectable.

public <U> Optional<T>
modeBy(Function<? super T, ? extends U> function)

Get the mode, i.e. the value that appears most often in the collectable.

public boolean
noneMatch(Predicate<? super T> predicate)

Whether no element in the collectable matches a given predicate.

public Optional<T>
percentile(double percentile)

Get the discrete percentile value.

public Optional<T>
percentile(double percentile, Comparator<? super T> comparator)

Get the discrete percentile value.

public <U extends Comparable<? super U>> Optional<T>
percentileBy(double percentile, Function<? super T, ? extends U> function)

Get the discrete percentile value by a function.

public <U> Optional<T>
percentileBy(double percentile, Function<? super T, ? extends U> function, Comparator<? super U> comparator)

Get the discrete percentile value by a function.

public Optional<T>
sum()

Get the sum of the elements in this collectable.

public <U> Optional<U>
sum(Function<? super T, ? extends U> function)

Get the sum of the elements in this collectable.

public double
sumDouble(ToDoubleFunction<? super T> function)

Get the sum of the elements in this collectable as double.

public int
sumInt(ToIntFunction<? super T> function)

Get the sum of the elements in this collectable as int.

public long
sumLong(ToLongFunction<? super T> function)

Get the sum of the elements in this collectable as long.

public <C extends Collection<T>> C
toCollection(Supplier<C> factory)

Collect the collectable into a Collection.

public List<T>
toList()

Collect the collectable into an ArrayList.

public <L extends List<T>> L
toList(Supplier<L> factory)

Collect the collectable into a List.

public <K, V> Map<K, V>
toMap(Function<? super T, ? extends K> keyMapper, Function<? super T, ? extends V> valueMapper)

Collect the collectable into a Map.

public <K> Map<K, T>
toMap(Function<? super T, ? extends K> keyMapper)

Collect the collectable into a Map with the given keys and the self element as value.

public Set<T>
toSet()

Collect the collectable into a LinkedHashSet.

public <S extends Set<T>> S
toSet(Supplier<S> factory)

Collect the collectable into a Set.

public String
toString(CharSequence delimiter)

Consume a stream and concatenate all elements using a separator.

public String
public List<T>
toUnmodifiableList()

Collect the collectable into an unmodifiable List.

public Set<T>
toUnmodifiableSet()

Collect the collectable into an unmodifiable Set.