public interface Collectable<T>
Seq or
Window delegating common aggregation functions to
collect(Collector)
| Modifier and Type | Method and Description |
|---|---|
boolean |
allMatch(Predicate
Whether all elements in the collectable match a given predicate.
|
boolean |
anyMatch(Predicate
Whether any element in the collectable matches a given predicate.
|
Optional |
avg()
Get the average of the elements in this collectable.
|
<U> Optional |
avg(Function
Get the average of the elements in this collectable.
|
double |
avgDouble(ToDoubleFunction
Get the average of the elements in this collectable as
double.
|
double |
avgInt(ToIntFunction
Get the average of the elements in this collectable as
int.
|
double |
avgLong(ToLongFunction
Get the average of the elements in this collectable as
long.
|
default <R1 |
collect(Collector
Collect this collectable into 2
Collectors.
|
default <R1 |
collect(Collector
Collect this collectable into 3
Collectors.
|
default <R1 |
collect(Collector
Collect this collectable into 4
Collectors.
|
default <R1 |
collect(Collector
Collect this collectable into 5
Collectors.
|
default <R1 |
collect(Collector
Collect this collectable into 6
Collectors.
|
default <R1 |
collect(Collector
Collect this collectable into 7
Collectors.
|
default <R1 |
collect(Collector
Collect this collectable into 8
Collectors.
|
default <R1 |
collect(Collector
Collect this collectable into 9
Collectors.
|
default <R1 |
collect(Collector
Collect this collectable into 10
Collectors.
|
default <R1 |
collect(Collector
Collect this collectable into 11
Collectors.
|
default <R1 |
collect(Collector
Collect this collectable into 12
Collectors.
|
default <R1 |
collect(Collector
Collect this collectable into 13
Collectors.
|
default <R1 |
collect(Collector
Collect this collectable into 14
Collectors.
|
default <R1 |
collect(Collector
Collect this collectable into 15
Collectors.
|
default <R1 |
collect(Collector
Collect this collectable into 16
Collectors.
|
<R |
collect(Collector
Collect this collectable.
|
long |
count()
Count the values in this collectable.
|
long |
count(Predicate
Count the values in this collectable, for which a predicate evaluates to true.
|
long |
countDistinct()
Count the distinct values in this collectable.
|
long |
countDistinct(Predicate
Count the distinct values in this collectable, for which a predicate evaluates to true.
|
<U> long |
countDistinctBy(Function
Count the distinct values of a given expression in this collectable.
|
<U> long |
countDistinctBy(Function
Count the distinct values of a given expression in this collectable, for which a predicate evaluates to true.
|
Optional |
max()
Get the maximum value.
|
Optional |
max(Comparator
Get the maximum value by a function.
|
<U extends Comparable |
max(Function
Get the maximum value by a function.
|
<U> Optional |
max(Function
Get the maximum value by a function.
|
<U extends Comparable |
maxBy(Function
Get the maximum value by a function.
|
<U> Optional |
maxBy(Function
Get the maximum value by a function.
|
Optional |
median()
Get the median value.
|
Optional |
median(Comparator
Get the median value.
|
<U extends Comparable |
medianBy(Function
Get the median value by a function.
|
<U> Optional |
medianBy(Function
Get the median value by a function.
|
Optional |
min()
Get the minimum value.
|
Optional |
min(Comparator
Get the minimum value by a function.
|
<U extends Comparable |
min(Function
Get the minimum value by a function.
|
<U> Optional |
min(Function
Get the minimum value by a function.
|
<U extends Comparable |
minBy(Function
Get the minimum value by a function.
|
<U> Optional |
minBy(Function
Get the minimum value by a function.
|
Optional |
mode()
Get the mode, i.e.
|
boolean |
noneMatch(Predicate
Whether no element in the collectable matches a given predicate.
|
Optional |
percentile(double percentile)
Get the discrete percentile value.
|
Optional |
percentile(double percentile, Comparator
Get the discrete percentile value.
|
<U extends Comparable |
percentileBy(double percentile, Function
Get the discrete percentile value by a function.
|
<U> Optional |
percentileBy(double percentile, Function
Get the discrete percentile value by a function.
|
Optional |
sum()
Get the sum of the elements in this collectable.
|
<U> Optional |
sum(Function
Get the sum of the elements in this collectable.
|
double |
sumDouble(ToDoubleFunction
Get the sum of the elements in this collectable as
double.
|
int |
sumInt(ToIntFunction
Get the sum of the elements in this collectable as
int.
|
long |
sumLong(ToLongFunction
Get the sum of the elements in this collectable as
long.
|
<C extends Collection |
toCollection(Supplier
Collect the collectable into a
Collection.
|
List |
toList()
Collect the collectable into an
ArrayList.
|
<L extends List |
toList(Supplier
Collect the collectable into a
List.
|
<K |
toMap(Function
Collect the collectable into a
Map.
|
Set |
toSet()
Collect the collectable into a
LinkedHashSet.
|
<S extends Set |
toSet(Supplier
Collect the collectable into a
Set.
|
String |
toString(CharSequence
Consume a stream and concatenate all elements using a separator.
|
String |
toString(CharSequence
Shortcut for calling
Stream#collect(Collector) with a
Collectors collector.
|
@Generated(value="This method was generated using jOOQ-tools") default <R1,R2 ,A1 ,A2> Tuple2 <R1 ,R2> collect(Collector <? super T ,A1 ,R1> collector1, Collector <? super T ,A2 ,R2> collector2)
Collectors.
@Generated(value="This method was generated using jOOQ-tools") 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)
Collectors.
@Generated(value="This method was generated using jOOQ-tools") 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)
Collectors.
@Generated(value="This method was generated using jOOQ-tools") 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)
Collectors.
@Generated(value="This method was generated using jOOQ-tools") 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)
Collectors.
@Generated(value="This method was generated using jOOQ-tools") 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)
Collectors.
@Generated(value="This method was generated using jOOQ-tools") 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)
Collectors.
@Generated(value="This method was generated using jOOQ-tools") 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)
Collectors.
@Generated(value="This method was generated using jOOQ-tools") 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)
Collectors.
@Generated(value="This method was generated using jOOQ-tools") 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)
Collectors.
@Generated(value="This method was generated using jOOQ-tools") 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)
Collectors.
@Generated(value="This method was generated using jOOQ-tools") 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)
Collectors.
@Generated(value="This method was generated using jOOQ-tools") 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)
Collectors.
@Generated(value="This method was generated using jOOQ-tools") 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)
Collectors.
@Generated(value="This method was generated using jOOQ-tools") 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)
Collectors.
long count()
long count(Predicate<? super T> predicate)
long countDistinct()
long countDistinct(Predicate<? super T> predicate)
<U> long countDistinctBy(Function<? super T ,? extends U> function)
<U> long countDistinctBy(Function<? super T ,? extends U> function, Predicate <? super U> predicate)
<U> Optional<U> sum(Function <? super T ,? extends U> function)
int sumInt(ToIntFunction<? super T> function)
int.
long sumLong(ToLongFunction<? super T> function)
long.
double sumDouble(ToDoubleFunction<? super T> function)
double.
<U> Optional<U> avg(Function <? super T ,? extends U> function)
double avgInt(ToIntFunction<? super T> function)
int.
double avgLong(ToLongFunction<? super T> function)
long.
double avgDouble(ToDoubleFunction<? super T> function)
double.
Optional<T> min()
This makes the unsafe assumption that <T extends Comparable<? super T>>
Optional<T> min(Comparator <? super T> comparator)
<U extends Comparable<? super U>> Optional <U> min(Function <? super T ,? extends U> function)
<U> Optional<U> min(Function <? super T ,? extends U> function, Comparator <? super U> comparator)
<U extends Comparable<? super U>> Optional <T> minBy(Function <? super T ,? extends U> function)
<U> Optional<T> minBy(Function <? super T ,? extends U> function, Comparator <? super U> comparator)
Optional<T> max()
This makes the unsafe assumption that <T extends Comparable<? super T>>
Optional<T> max(Comparator <? super T> comparator)
<U extends Comparable<? super U>> Optional <U> max(Function <? super T ,? extends U> function)
<U> Optional<U> max(Function <? super T ,? extends U> function, Comparator <? super U> comparator)
<U extends Comparable<? super U>> Optional <T> maxBy(Function <? super T ,? extends U> function)
<U> Optional<T> maxBy(Function <? super T ,? extends U> function, Comparator <? super U> comparator)
Optional<T> median()
This makes the unsafe assumption that <T extends Comparable<? super T>>
Optional<T> median(Comparator <? super T> comparator)
<U extends Comparable<? super U>> Optional <T> medianBy(Function <? super T ,? extends U> function)
<U> Optional<T> medianBy(Function <? super T ,? extends U> function, Comparator <? super U> comparator)
Optional<T> percentile(double percentile)
This makes the unsafe assumption that <T extends Comparable<? super T>>
Optional<T> percentile(double percentile, Comparator <? super T> comparator)
<U extends Comparable<? super U>> Optional <T> percentileBy(double percentile, Function <? super T ,? extends U> function)
<U> Optional<T> percentileBy(double percentile, Function <? super T ,? extends U> function, Comparator <? super U> comparator)
boolean allMatch(Predicate<? super T> predicate)
boolean anyMatch(Predicate<? super T> predicate)
boolean noneMatch(Predicate<? super T> predicate)
Set<T> toSet()
LinkedHashSet.
<C extends Collection<T>> C toCollection(Supplier <C> factory)
Collection.
<K,V> Map <K ,V> toMap(Function <? super T ,? extends K> keyMapper, Function <? super T ,? extends V> valueMapper)
Map.
#toMap(Stream, Function, Function)
StringtoString(CharSequence delimiter)
StringtoString(CharSequence delimiter, CharSequence prefix, CharSequence suffix)
Stream#collect(Collector) with a
Collectors.joining(CharSequence, CharSequence, CharSequence) collector.