public abstract class Collectors extends Object
java.util.stream.Collectors}
Modifier and Type | Class and Description |
---|---|
static class |
Collectors.MoreCollectors |
Modifier and Type | Method and Description |
---|---|
static <T> Collector<T,?,u.Optional<BigDecimal>> |
averagingBigDecimal(Function<? super T,BigDecimal> mapper) |
static <T> Collector<T,?,BigDecimal> |
averagingBigDecimalForNonEmpty(Function<? super T,BigDecimal> mapper) |
static <T> Collector<T,?,u.Optional<BigDecimal>> |
averagingBigInteger(Function<? super T,BigInteger> mapper) |
static <T> Collector<T,?,BigDecimal> |
averagingBigIntegerForNonEmpty(Function<? super T,BigInteger> mapper) |
static <T> Collector<T,?,u.OptionalDouble> |
averagingDouble(ToDoubleFunction<? super T> mapper) |
static <T> Collector<T,?,Double> |
averagingDoubleForNonEmpty(ToDoubleFunction<? super T> mapper) |
static <T> Collector<T,?,u.OptionalDouble> |
averagingInt(ToIntFunction<? super T> mapper) |
static <T> Collector<T,?,Double> |
averagingIntForNonEmpty(ToIntFunction<? super T> mapper) |
static <T> Collector<T,?,u.OptionalDouble> |
averagingLong(ToLongFunction<? super T> mapper) |
static <T> Collector<T,?,Double> |
averagingLongForNonEmpty(ToLongFunction<? super T> mapper) |
static <T,A,R,RR> Collector<T,A,RR> |
collectingAndThen(Collector<T,A,R> downstream,
Function<R,RR> finisher) |
static <T,A,R,RR> Collector<T,A,RR> |
collectingAndThen(Collector<T,A,R> downstream,
Function<R,RR> finisher) |
static <T> Collector<T,?,List<?>> |
combine(Collection<? extends Collector<? super T,?,?>> collectors) |
static <T,A1,A2,R1,R2> |
combine(Collector<? super T,A1,R1> collector1,
Collector<? super T,A2,R2> collector2) |
static <T,A1,A2,R1,R2> |
combine(Collector<? super T,A1,R1> collector1,
Collector<? super T,A2,R2> collector2) |
static <T,A1,A2,R1,R2,R> |
combine(Collector<? super T,A1,R1> collector1,
Collector<? super T,A2,R2> collector2,
BiFunction<? super R1,? super R2,R> finisher) |
static <T,A1,A2,R1,R2,R> |
combine(Collector<? super T,A1,R1> collector1,
Collector<? super T,A2,R2> collector2,
BiFunction<? super R1,? super R2,R> finisher) |
static <T,A1,A2,A3,R1,R2,R3> |
combine(Collector<? super T,A1,R1> collector1,
Collector<? super T,A2,R2> collector2,
Collector<? super T,A3,R3> collector3) |
static <T,A1,A2,A3,R1,R2,R3> |
combine(Collector<? super T,A1,R1> collector1,
Collector<? super T,A2,R2> collector2,
Collector<? super T,A3,R3> collector3) |
static <T,A1,A2,A3,A4,R1,R2,R3,R4> |
combine(Collector<? super T,A1,R1> collector1,
Collector<? super T,A2,R2> collector2,
Collector<? super T,A3,R3> collector3,
Collector<? super T,A4,R4> collector4) |
static <T,A1,A2,A3,A4,R1,R2,R3,R4> |
combine(Collector<? super T,A1,R1> collector1,
Collector<? super T,A2,R2> collector2,
Collector<? super T,A3,R3> collector3,
Collector<? super T,A4,R4> collector4) |
static <T,A1,A2,A3,A4,A5,R1,R2,R3,R4,R5> |
combine(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) |
static <T,A1,A2,A3,A4,A5,R1,R2,R3,R4,R5> |
combine(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) |
static <T,A1,A2,A3,R1,R2,R3,R> |
combine(Collector<? super T,A1,R1> collector1,
Collector<? super T,A2,R2> collector2,
Collector<? super T,A3,R3> collector3,
TriFunction<? super R1,? super R2,? super R3,R> finisher) |
static <T,A1,A2,A3,R1,R2,R3,R> |
combine(Collector<? super T,A1,R1> collector1,
Collector<? super T,A2,R2> collector2,
Collector<? super T,A3,R3> collector3,
TriFunction<? super R1,? super R2,? super R3,R> finisher) |
static <T> Collector<T,?,List<?>> |
combine(List<? extends Collector<? super T,?,?>> collectors) |
static Collector<CharSequence,?,String> |
commonPrefix()
It's copied from StreamEx: https://github.com/amaembo/streamex under Apache License v2 and may be modified.
|
static Collector<CharSequence,?,String> |
commonSuffix()
It's copied from StreamEx: https://github.com/amaembo/streamex under Apache License v2 and may be modified.
|
static <T> Collector<T,?,Long> |
counting() |
static <T,K> Collector<T,?,Map<K,Long>> |
countingBy(Function<? super T,? extends K> keyMapper) |
static <T,K,M extends Map<K,Long>> |
countingBy(Function<? super T,? extends K> keyMapper,
Supplier<? extends M> mapFactory) |
static <T> Collector<T,?,Integer> |
countingInt() |
static <T,K> Collector<T,?,Map<K,Integer>> |
countingIntBy(Function<? super T,? extends K> keyMapper) |
static <T,K,M extends Map<K,Integer>> |
countingIntBy(Function<? super T,? extends K> keyMapper,
Supplier<? extends M> mapFactory) |
static <T> Collector<T,?,List<T>> |
distinctBy(Function<? super T,?> mapper)
It's copied from StreamEx: https://github.com/amaembo/streamex under Apache License v2 and may be modified.
|
static <T> Collector<T,?,Integer> |
distinctCount(Function<? super T,?> mapper)
It's copied from StreamEx: https://github.com/amaembo/streamex under Apache License v2 and may be modified.
|
static <T> Collector<T,?,List<T>> |
filtering(Predicate<? super T> predicate)
It's copied from StreamEx: https://github.com/amaembo/streamex under Apache License v2 and may be modified.
|
static <T,A,R> Collector<T,?,R> |
filtering(Predicate<? super T> predicate,
Collector<? super T,A,R> downstream)
It's copied from StreamEx: https://github.com/amaembo/streamex under Apache License v2 and may be modified.
|
static <T> Collector<T,?,u.Optional<T>> |
first()
Only works for sequential Stream.
|
static <T> Collector<T,?,List<T>> |
first(int n)
Only works for sequential Stream.
|
static <T,T2,U> Collector<T,?,List<U>> |
flatMapping(Function<? super T,? extends Stream<? extends T2>> flatMapper,
BiFunction<? super T,? super T2,? extends U> mapper) |
static <T,T2,U,A,R> |
flatMapping(Function<? super T,? extends Stream<? extends T2>> flatMapper,
BiFunction<? super T,? super T2,? extends U> mapper,
Collector<? super U,A,R> downstream) |
static <T,U> Collector<T,?,List<U>> |
flatMapping(Function<? super T,? extends Stream<? extends U>> mapper) |
static <T,U,A,R> Collector<T,?,R> |
flatMapping(Function<? super T,? extends Stream<? extends U>> mapper,
Collector<? super U,A,R> downstream) |
static <T,K,V> Collector<T,?,ListMultimap<K,V>> |
flatMappingKeyToMultimap(Function<? super T,Stream<? extends K>> flatKeyMapper,
Function<? super T,V> valueMapper) |
static <T,K,V,C extends Collection<V>,M extends Multimap<K,V,C>> |
flatMappingKeyToMultimap(Function<? super T,Stream<? extends K>> flatKeyMapper,
Function<? super T,V> valueMapper,
Supplier<? extends M> mapFactory) |
static <T,K,V> Collector<T,?,ListMultimap<K,V>> |
flatMappingValueToMultimap(Function<? super T,K> keyMapper,
Function<? super T,? extends Stream<? extends V>> flatValueMapper) |
static <T,K,V,C extends Collection<V>,M extends Multimap<K,V,C>> |
flatMappingValueToMultimap(Function<? super T,K> keyMapper,
Function<? super T,? extends Stream<? extends V>> flatValueMapper,
Supplier<? extends M> mapFactory) |
static <T,T2,U> Collector<T,?,List<U>> |
flattMapping(Function<? super T,? extends Collection<? extends T2>> flatMapper,
BiFunction<? super T,? super T2,? extends U> mapper) |
static <T,T2,U,A,R> |
flattMapping(Function<? super T,? extends Collection<? extends T2>> flatMapper,
BiFunction<? super T,? super T2,? extends U> mapper,
Collector<? super U,A,R> downstream) |
static <T,U> Collector<T,?,List<U>> |
flattMapping(Function<? super T,? extends Collection<? extends U>> mapper) |
static <T,U,A,R> Collector<T,?,R> |
flattMapping(Function<? super T,? extends Collection<? extends U>> mapper,
Collector<? super U,A,R> downstream) |
static <T,K,V> Collector<T,?,ListMultimap<K,V>> |
flattMappingKeyToMultimap(Function<? super T,? extends Collection<? extends K>> flatKeyMapper,
Function<? super T,V> valueMapper) |
static <T,K,V,C extends Collection<V>,M extends Multimap<K,V,C>> |
flattMappingKeyToMultimap(Function<? super T,? extends Collection<? extends K>> flatKeyMapper,
Function<? super T,V> valueMapper,
Supplier<? extends M> mapFactory) |
static <T,K,V> Collector<T,?,ListMultimap<K,V>> |
flattMappingValueToMultimap(Function<? super T,K> keyMapper,
Function<? super T,? extends Collection<? extends V>> flatValueMapper) |
static <T,K,V,C extends Collection<V>,M extends Multimap<K,V,C>> |
flattMappingValueToMultimap(Function<? super T,K> keyMapper,
Function<? super T,? extends Collection<? extends V>> flatValueMapper,
Supplier<? extends M> mapFactory) |
static <T,K> Collector<T,?,Map<K,List<T>>> |
groupingBy(Function<? super T,? extends K> keyMapper) |
static <T,K,A,D> Collector<T,?,Map<K,D>> |
groupingBy(Function<? super T,? extends K> keyMapper,
Collector<? super T,A,D> downstream) |
static <T,K,A,D,M extends Map<K,D>> |
groupingBy(Function<? super T,? extends K> keyMapper,
Collector<? super T,A,D> downstream,
Supplier<? extends M> mapFactory) |
static <T,K,M extends Map<K,List<T>>> |
groupingBy(Function<? super T,? extends K> keyMapper,
Supplier<? extends M> mapFactory) |
static <T,K> Collector<T,?,ConcurrentMap<K,List<T>>> |
groupingByConcurrent(Function<? super T,? extends K> keyMapper) |
static <T,K,A,D> Collector<T,?,ConcurrentMap<K,D>> |
groupingByConcurrent(Function<? super T,? extends K> keyMapper,
Collector<? super T,A,D> downstream) |
static <T,K,A,D,M extends ConcurrentMap<K,D>> |
groupingByConcurrent(Function<? super T,? extends K> keyMapper,
Collector<? super T,A,D> downstream,
Supplier<? extends M> mapFactory) |
static <T,K,M extends ConcurrentMap<K,List<T>>> |
groupingByConcurrent(Function<? super T,? extends K> keyMapper,
Supplier<? extends M> mapFactory) |
static Collector<CharSequence,?,String> |
joining() |
static Collector<CharSequence,?,String> |
joining(CharSequence delimiter) |
static Collector<CharSequence,?,String> |
joining(CharSequence delimiter,
CharSequence prefix,
CharSequence suffix) |
static <T> Collector<T,?,u.Optional<T>> |
last()
Only works for sequential Stream.
|
static <T> Collector<T,?,List<T>> |
last(int n)
Only works for sequential Stream.
|
static <T,U> Collector<T,?,List<U>> |
mapping(Function<? super T,? extends U> mapper) |
static <T,U,A,R> Collector<T,?,R> |
mapping(Function<? super T,? extends U> mapper,
Collector<? super U,A,R> downstream) |
static <T extends Comparable<? super T>> |
max() |
static <T> Collector<T,?,u.Optional<T>> |
max(Comparator<? super T> comparator) |
static <T extends Comparable<? super T>> |
maxAll()
It's copied from StreamEx: https://github.com/amaembo/streamex under Apache License v2 and may be modified.
|
static <T extends Comparable<? super T>> |
maxAll(boolean areAllLargestSame)
Use occurrences to save the count of largest objects if
areAllLargestSame = true (e.g. |
static <T extends Comparable,A,D> |
maxAll(Collector<T,A,D> downstream)
It's copied from StreamEx: https://github.com/amaembo/streamex under Apache License v2 and may be modified.
|
static <T> Collector<T,?,List<T>> |
maxAll(Comparator<? super T> comparator)
It's copied from StreamEx: https://github.com/amaembo/streamex under Apache License v2 and may be modified.
|
static <T,A,D> Collector<T,?,D> |
maxAll(Comparator<? super T> comparator,
Collector<? super T,A,D> downstream)
It's copied from StreamEx: https://github.com/amaembo/streamex under Apache License v2 and may be modified.
|
static <T> Collector<T,?,List<T>> |
maxAll(Comparator<? super T> comparator,
int atMostSize) |
static <T> Collector<T,?,List<T>> |
maxAll(Comparator<? super T> comparator,
int atMostSize,
boolean areAllLargestSame)
Use occurrences to save the count of largest objects if
areAllLargestSame = true (e.g. |
static <T extends Comparable<? super T>> |
maxAll(int atMostSize,
boolean areAllLargestSame)
Use occurrences to save the count of largest objects if
areAllLargestSame = true (e.g. |
static <T extends Comparable,A,D> |
maxAlll(Collector<T,A,D> downstream) |
static <T,A,D> Collector<T,?,Pair<u.Optional<T>,D>> |
maxAlll(Comparator<? super T> comparator,
Collector<? super T,A,D> downstream) |
static <T,A,D,R> Collector<T,?,R> |
maxAlll(Comparator<? super T> comparator,
Collector<? super T,A,D> downstream,
Function<Pair<u.Optional<T>,D>,R> finisher) |
static <T> Collector<T,?,u.Optional<T>> |
maxBy(Function<? super T,? extends Comparable> keyMapper) |
static <T> Collector<T,?,T> |
maxByOrGet(Function<? super T,? extends Comparable> keyMapper,
Supplier<? extends T> other) |
static <T> Collector<T,?,T> |
maxByOrThrow(Function<? super T,? extends Comparable> keyMapper) |
static <T,X extends RuntimeException> |
maxByOrThrow(Function<? super T,? extends Comparable> keyMapper,
Supplier<? extends X> exceptionSupplier) |
static <T extends Comparable<? super T>> |
maxForNonEmpty() |
static <T> Collector<T,?,T> |
maxForNonEmpty(Comparator<? super T> comparator) |
static <T> Collector<T,?,T> |
maxOrGet(Comparator<? super T> comparator,
Supplier<? extends T> other) |
static <T> Collector<T,?,T> |
maxOrThrow(Comparator<? super T> comparator) |
static <T,X extends RuntimeException> |
maxOrThrow(Comparator<? super T> comparator,
Supplier<? extends X> exceptionSupplier) |
static <T extends Comparable<? super T>> |
min() |
static <T> Collector<T,?,u.Optional<T>> |
min(Comparator<? super T> comparator) |
static <T extends Comparable<? super T>> |
minAll()
It's copied from StreamEx: https://github.com/amaembo/streamex under Apache License v2 and may be modified.
|
static <T extends Comparable<? super T>> |
minAll(boolean areAllSmallestSame)
Use occurrences to save the count of largest objects if
areAllSmallestSame = true (e.g. |
static <T extends Comparable,A,D> |
minAll(Collector<T,A,D> downstream)
It's copied from StreamEx: https://github.com/amaembo/streamex under Apache License v2 and may be modified.
|
static <T> Collector<T,?,List<T>> |
minAll(Comparator<? super T> comparator)
It's copied from StreamEx: https://github.com/amaembo/streamex under Apache License v2 and may be modified.
|
static <T,A,D> Collector<T,?,D> |
minAll(Comparator<? super T> comparator,
Collector<T,A,D> downstream)
It's copied from StreamEx: https://github.com/amaembo/streamex under Apache License v2 and may be modified.
|
static <T> Collector<T,?,List<T>> |
minAll(Comparator<? super T> comparator,
int atMostSize) |
static <T> Collector<T,?,List<T>> |
minAll(Comparator<? super T> comparator,
int atMostSize,
boolean areAllSmallestSame)
Use occurrences to save the count of largest objects if
areAllSmallestSame = true (e.g. |
static <T extends Comparable<? super T>> |
minAll(int atMostSize,
boolean areAllSmallestSame)
Use occurrences to save the count of largest objects if
areAllSmallestSame = true (e.g. |
static <T extends Comparable,A,D> |
minAlll(Collector<T,A,D> downstream) |
static <T,A,D> Collector<T,?,Pair<u.Optional<T>,D>> |
minAlll(Comparator<? super T> comparator,
Collector<? super T,A,D> downstream) |
static <T,A,D,R> Collector<T,?,R> |
minAlll(Comparator<? super T> comparator,
Collector<? super T,A,D> downstream,
Function<Pair<u.Optional<T>,D>,R> finisher) |
static <T> Collector<T,?,u.Optional<T>> |
minBy(Function<? super T,? extends Comparable> keyMapper) |
static <T> Collector<T,?,T> |
minByOrGet(Function<? super T,? extends Comparable> keyMapper,
Supplier<? extends T> other) |
static <T> Collector<T,?,T> |
minByOrThrow(Function<? super T,? extends Comparable> keyMapper) |
static <T,X extends RuntimeException> |
minByOrThrow(Function<? super T,? extends Comparable> keyMapper,
Supplier<? extends X> exceptionSupplier) |
static <T extends Comparable<? super T>> |
minForNonEmpty() |
static <T> Collector<T,?,T> |
minForNonEmpty(Comparator<? super T> comparator) |
static <T extends Comparable,R> |
minMax() |
static <T,R> Collector<T,?,u.Optional<Pair<T,T>>> |
minMax(Comparator<? super T> comparator) |
static <T,R> Collector<T,?,u.Optional<R>> |
minMax(Comparator<? super T> comparator,
BiFunction<? super T,? super T,? extends R> finisher)
It's copied from StreamEx: https://github.com/amaembo/streamex under Apache License v2 and may be modified.
|
static <T,R> Collector<T,?,u.Optional<Pair<T,T>>> |
minMaxBy(Function<? super T,? extends Comparable> keyMapper) |
static <T,R> Collector<T,?,u.Optional<R>> |
minMaxBy(Function<? super T,? extends Comparable> keyMapper,
BiFunction<? super T,? super T,? extends R> finisher) |
static <T extends Comparable<? super T>> |
minMaxForNonEmpty() |
static <T> Collector<T,?,Pair<T,T>> |
minMaxForNonEmpty(Comparator<? super T> comparator) |
static <T> Collector<T,?,T> |
minOrGet(Comparator<? super T> comparator,
Supplier<? extends T> other) |
static <T> Collector<T,?,T> |
minOrThrow(Comparator<? super T> comparator) |
static <T,X extends RuntimeException> |
minOrThrow(Comparator<? super T> comparator,
Supplier<? extends X> exceptionSupplier) |
static <T> Collector<T,?,u.Optional<T>> |
onlyOne()
DuplicatedResultException is threw if there are more than one values are collected. |
static <T> Collector<T,?,u.Optional<T>> |
onlyOne(Predicate<? super T> predicate)
DuplicatedResultException is threw if there are more than one values are collected. |
static <T> Collector<T,?,Map<Boolean,List<T>>> |
partitioningBy(Predicate<? super T> predicate) |
static <T,D,A> Collector<T,?,Map<Boolean,D>> |
partitioningBy(Predicate<? super T> predicate,
Collector<? super T,A,D> downstream) |
static <T> Collector<T,?,u.Optional<T>> |
reducing(BinaryOperator<T> op) |
static <T,U> Collector<T,?,u.Optional<U>> |
reducing(Function<? super T,? extends U> mapper,
BinaryOperator<U> op) |
static <T> Collector<T,?,T> |
reducing(T identity,
BinaryOperator<T> op) |
static <T,U> Collector<T,?,U> |
reducing(U identity,
Function<? super T,? extends U> mapper,
BinaryOperator<U> op) |
static <T> Collector<T,?,T> |
reducingOrGet(BinaryOperator<T> op,
Supplier<? extends T> other) |
static <T,U> Collector<T,?,U> |
reducingOrGet(Function<? super T,? extends U> mapper,
BinaryOperator<U> op,
Supplier<? extends U> other) |
static <T> Collector<T,?,T> |
reducingOrThrow(BinaryOperator<T> op) |
static <T,X extends RuntimeException> |
reducingOrThrow(BinaryOperator<T> op,
Supplier<? extends X> exceptionSupplier) |
static <T,U> Collector<T,?,U> |
reducingOrThrow(Function<? super T,? extends U> mapper,
BinaryOperator<U> op) |
static <T,U,X extends RuntimeException> |
reducingOrThrow(Function<? super T,? extends U> mapper,
BinaryOperator<U> op,
Supplier<? extends X> exceptionSupplier) |
static <T,R> Collector<T,?,R> |
streaming(Function<? super Stream<T>,R> streamingCollector)
Deprecated.
|
static <T,R> Collector<T,?,R> |
streaming(long maxWaitIntervalInMillis,
Function<? super Stream<T>,R> streamingCollector)
Deprecated.
|
static <T,R> Collector<T,?,R> |
streaming(long maxWaitIntervalInMillis,
Supplier<? extends BlockingQueue<T>> queueSupplier,
Function<? super Stream<T>,R> streamingCollector)
Deprecated.
|
static <T,R> Collector<T,?,R> |
streaming(Supplier<? extends BlockingQueue<T>> queueSupplier,
Function<? super Stream<T>,ContinuableFuture<R>> streamingCollector,
long maxWaitIntervalInMillis)
Deprecated.
|
static <T,R> Collector<T,?,R> |
streaming(Supplier<? extends BlockingQueue<T>> queueSupplier,
Function<? super Stream<T>,R> streamingCollector)
Deprecated.
|
static <T> Collector<T,?,ByteSummaryStatistics> |
summarizingByte(ToByteFunction<? super T> mapper) |
static <T> Collector<T,?,CharSummaryStatistics> |
summarizingChar(ToCharFunction<? super T> mapper) |
static <T> Collector<T,?,DoubleSummaryStatistics> |
summarizingDouble(ToDoubleFunction<? super T> mapper) |
static <T> Collector<T,?,FloatSummaryStatistics> |
summarizingFloat(ToFloatFunction<? super T> mapper) |
static <T> Collector<T,?,IntSummaryStatistics> |
summarizingInt(ToIntFunction<? super T> mapper) |
static <T> Collector<T,?,LongSummaryStatistics> |
summarizingLong(ToLongFunction<? super T> mapper) |
static <T> Collector<T,?,ShortSummaryStatistics> |
summarizingShort(ToShortFunction<? super T> mapper) |
static <T> Collector<T,?,BigDecimal> |
summingBigDecimal(Function<? super T,BigDecimal> mapper) |
static <T> Collector<T,?,BigInteger> |
summingBigInteger(Function<? super T,BigInteger> mapper) |
static <T> Collector<T,?,Double> |
summingDouble(ToDoubleFunction<? super T> mapper) |
static <T> Collector<T,?,Long> |
summingInt(ToIntFunction<? super T> mapper) |
static <T> Collector<T,?,Long> |
summingLong(ToLongFunction<? super T> mapper) |
static <T> Collector<T,?,Object[]> |
toArray() |
static <T,A> Collector<T,?,A[]> |
toArray(IntFunction<A[]> arraySupplier) |
static <T,A> Collector<T,?,A[]> |
toArray(Supplier<A[]> arraySupplier) |
static <T,K,V> Collector<T,?,BiMap<K,V>> |
toBiMap(Function<? super T,? extends K> keyMapper,
Function<? super T,? extends V> valueMapper) |
static <T,K,V> Collector<T,?,BiMap<K,V>> |
toBiMap(Function<? super T,? extends K> keyMapper,
Function<? super T,? extends V> valueMapper,
BinaryOperator<V> mergeFunction) |
static <T,K,V> Collector<T,?,BiMap<K,V>> |
toBiMap(Function<? super T,? extends K> keyMapper,
Function<? super T,? extends V> valueMapper,
BinaryOperator<V> mergeFunction,
Supplier<BiMap<K,V>> mapFactory) |
static <T,K,V> Collector<T,?,BiMap<K,V>> |
toBiMap(Function<? super T,? extends K> keyMapper,
Function<? super T,? extends V> valueMapper,
Supplier<BiMap<K,V>> mapFactory) |
static Collector<Boolean,?,boolean[]> |
toBooleanArray() |
static Collector<Boolean,?,BooleanList> |
toBooleanList() |
static Collector<Byte,?,byte[]> |
toByteArray() |
static Collector<Byte,?,ByteList> |
toByteList() |
static Collector<Character,?,char[]> |
toCharArray() |
static Collector<Character,?,CharList> |
toCharList() |
static <T,C extends Collection<T>> |
toCollection(Supplier<? extends C> collectionFactory) |
static <T,C extends Collection<T>> |
toCollection(Supplier<? extends C> collectionFactory,
int atMostSize) |
static <T,K,V> Collector<T,?,ConcurrentMap<K,V>> |
toConcurrentMap(Function<? super T,? extends K> keyMapper,
Function<? super T,? extends V> valueMapper) |
static <T,K,V> Collector<T,?,ConcurrentMap<K,V>> |
toConcurrentMap(Function<? super T,? extends K> keyMapper,
Function<? super T,? extends V> valueMapper,
BinaryOperator<V> mergeFunction) |
static <T,K,V,M extends ConcurrentMap<K,V>> |
toConcurrentMap(Function<? super T,? extends K> keyMapper,
Function<? super T,? extends V> valueMapper,
BinaryOperator<V> mergeFunction,
Supplier<? extends M> mapFactory) |
static <T,K,V,M extends ConcurrentMap<K,V>> |
toConcurrentMap(Function<? super T,? extends K> keyMapper,
Function<? super T,? extends V> valueMapper,
Supplier<? extends M> mapFactory) |
static <T> Collector<T,?,DataSet> |
toDataSet() |
static <T> Collector<T,?,DataSet> |
toDataSet(List<String> columnNames) |
static <T> Collector<T,?,Deque<T>> |
toDeque() |
static Collector<Double,?,double[]> |
toDoubleArray() |
static Collector<Double,?,DoubleList> |
toDoubleList() |
static Collector<Float,?,float[]> |
toFloatArray() |
static Collector<Float,?,FloatList> |
toFloatList() |
static <T> Collector<T,?,ImmutableList<T>> |
toImmutableList() |
static <K,V> Collector<Map.Entry<K,V>,?,ImmutableMap<K,V>> |
toImmutableMap() |
static <K,V> Collector<Map.Entry<K,V>,?,ImmutableMap<K,V>> |
toImmutableMap(BinaryOperator<V> mergeFunction) |
static <T,K,V> Collector<T,?,ImmutableMap<K,V>> |
toImmutableMap(Function<? super T,? extends K> keyMapper,
Function<? super T,? extends V> valueMapper) |
static <T,K,V> Collector<T,?,ImmutableMap<K,V>> |
toImmutableMap(Function<? super T,? extends K> keyMapper,
Function<? super T,? extends V> valueMapper,
BinaryOperator<V> mergeFunction) |
static <T> Collector<T,?,ImmutableSet<T>> |
toImmutableSet() |
static Collector<Integer,?,int[]> |
toIntArray() |
static Collector<Integer,?,IntList> |
toIntList() |
static <T,K,V> Collector<T,?,Map<K,V>> |
toLinkedHashMap(Function<? super T,? extends K> keyMapper,
Function<? super T,? extends V> valueMapper) |
static <T,K,V> Collector<T,?,Map<K,V>> |
toLinkedHashMap(Function<? super T,? extends K> keyMapper,
Function<? super T,? extends V> valueMapper,
BinaryOperator<V> mergeFunction) |
static <T> Collector<T,?,Set<T>> |
toLinkedHashSet() |
static <T> Collector<T,?,LinkedList<T>> |
toLinkedList() |
static <T> Collector<T,?,List<T>> |
toList() |
static <T> Collector<T,?,List<T>> |
toList(int atMostSize) |
static Collector<Long,?,long[]> |
toLongArray() |
static Collector<Long,?,LongList> |
toLongList() |
static <T> Collector<T,?,LongMultiset<T>> |
toLongMultiset() |
static <T> Collector<T,?,LongMultiset<T>> |
toLongMultiset(Supplier<LongMultiset<T>> supplier) |
static <K,V> Collector<Map.Entry<K,V>,?,Map<K,V>> |
toMap() |
static <K,V> Collector<Map.Entry<K,V>,?,Map<K,V>> |
toMap(BinaryOperator<V> mergeFunction) |
static <K,V,M extends Map<K,V>> |
toMap(BinaryOperator<V> mergeFunction,
Supplier<? extends M> mapFactory) |
static <T,K,A,D> Collector<T,?,Map<K,D>> |
toMap(Function<? super T,? extends K> keyMapper,
Collector<? super T,A,D> downstream) |
static <T,K,A,D,M extends Map<K,D>> |
toMap(Function<? super T,? extends K> keyMapper,
Collector<? super T,A,D> downstream,
Supplier<? extends M> mapFactory) |
static <T,K,V> Collector<T,?,Map<K,V>> |
toMap(Function<? super T,? extends K> keyMapper,
Function<? super T,? extends V> valueMapper) |
static <T,K,V> Collector<T,?,Map<K,V>> |
toMap(Function<? super T,? extends K> keyMapper,
Function<? super T,? extends V> valueMapper,
BinaryOperator<V> mergeFunction) |
static <T,K,V,M extends Map<K,V>> |
toMap(Function<? super T,? extends K> keyMapper,
Function<? super T,? extends V> valueMapper,
BinaryOperator<V> mergeFunction,
Supplier<? extends M> mapFactory) |
static <T,K,V,A,D> |
toMap(Function<? super T,? extends K> keyMapper,
Function<? super T,? extends V> valueMapper,
Collector<? super V,A,D> downstream) |
static <T,K,V,A,D,M extends Map<K,D>> |
toMap(Function<? super T,? extends K> keyMapper,
Function<? super T,? extends V> valueMapper,
Collector<? super V,A,D> downstream,
Supplier<? extends M> mapFactory) |
static <T,K,V,M extends Map<K,V>> |
toMap(Function<? super T,? extends K> keyMapper,
Function<? super T,? extends V> valueMapper,
Supplier<? extends M> mapFactory) |
static <K,V,M extends Map<K,V>> |
toMap(Supplier<? extends M> mapFactory) |
static <K,V> Collector<Map.Entry<? extends K,? extends V>,?,ListMultimap<K,V>> |
toMultimap() |
static <T,K> Collector<T,?,ListMultimap<K,T>> |
toMultimap(Function<? super T,? extends K> keyMapper) |
static <T,K,V> Collector<T,?,ListMultimap<K,V>> |
toMultimap(Function<? super T,? extends K> keyMapper,
Function<? super T,? extends V> valueMapper) |
static <T,K,V,C extends Collection<V>,M extends Multimap<K,V,C>> |
toMultimap(Function<? super T,? extends K> keyMapper,
Function<? super T,? extends V> valueMapper,
Supplier<? extends M> mapFactory) |
static <T,K,C extends Collection<T>,M extends Multimap<K,T,C>> |
toMultimap(Function<? super T,? extends K> keyMapper,
Supplier<? extends M> mapFactory) |
static <K,V,C extends Collection<V>,M extends Multimap<K,V,C>> |
toMultimap(Supplier<? extends M> mapFactory) |
static <T> Collector<T,?,Multiset<T>> |
toMultiset() |
static <T> Collector<T,?,Multiset<T>> |
toMultiset(Supplier<Multiset<T>> supplier) |
static <T> Collector<T,?,Queue<T>> |
toQueue() |
static <T> Collector<T,?,Set<T>> |
toSet() |
static <T> Collector<T,?,Set<T>> |
toSet(int atMostSize) |
static Collector<Short,?,short[]> |
toShortArray() |
static Collector<Short,?,ShortList> |
toShortList() |
public static <T,C extends Collection<T>> Collector<T,?,C> toCollection(Supplier<? extends C> collectionFactory)
public static <T> Collector<T,?,LinkedList<T>> toLinkedList()
public static <T> Collector<T,?,ImmutableList<T>> toImmutableList()
public static <T> Collector<T,?,ImmutableSet<T>> toImmutableSet()
public static <T,C extends Collection<T>> Collector<T,?,C> toCollection(Supplier<? extends C> collectionFactory, int atMostSize)
public static <T> Collector<T,?,LongMultiset<T>> toLongMultiset()
public static <T> Collector<T,?,LongMultiset<T>> toLongMultiset(Supplier<LongMultiset<T>> supplier)
public static <T,A> Collector<T,?,A[]> toArray(IntFunction<A[]> arraySupplier)
public static Collector<Boolean,?,BooleanList> toBooleanList()
public static Collector<Double,?,DoubleList> toDoubleList()
public static <T> Collector<T,?,u.Optional<T>> onlyOne()
DuplicatedResultException
is threw if there are more than one values are collected.public static <T> Collector<T,?,u.Optional<T>> onlyOne(Predicate<? super T> predicate)
DuplicatedResultException
is threw if there are more than one values are collected.predicate
- public static <T> Collector<T,?,u.Optional<T>> first()
UnsupportedOperationException
- operated by multiple threadspublic static <T> Collector<T,?,u.Optional<T>> last()
UnsupportedOperationException
- operated by multiple threadspublic static <T> Collector<T,?,List<T>> first(int n)
n
- UnsupportedOperationException
- operated by multiple threadspublic static <T> Collector<T,?,List<T>> last(int n)
n
- UnsupportedOperationException
- operated by multiple threadspublic static Collector<CharSequence,?,String> joining()
public static Collector<CharSequence,?,String> joining(CharSequence delimiter)
public static Collector<CharSequence,?,String> joining(CharSequence delimiter, CharSequence prefix, CharSequence suffix)
public static <T> Collector<T,?,List<T>> filtering(Predicate<? super T> predicate)
Collector
which filters input elements by the supplied
predicate, collecting them to the list.
This method behaves like
filtering(predicate, Collectors.toList())
.
There are no guarantees on the type, mutability, serializability, or
thread-safety of the List
returned.
T
- the type of the input elementspredicate
- a filter function to be applied to the input elementsList
filtering(Predicate, Collector)
public static <T,A,R> Collector<T,?,R> filtering(Predicate<? super T> predicate, Collector<? super T,A,R> downstream)
Collector
which passes only those elements to the
specified downstream collector which match given predicate.
This method returns a short-circuiting collector if downstream collector is short-circuiting.
The operation performed by the returned collector is equivalent to
stream.filter(predicate).collect(downstream)
. This collector is
mostly useful as a downstream collector in cascaded operation involving
#pairing(Collector, Collector, BiFunction)
collector.
This method is similar to Collectors.filtering
method which
appears in JDK 9. However when downstream collector is
short-circuiting
, this method will also return a short-circuiting collector.
T
- the type of the input elementsA
- intermediate accumulation type of the downstream collectorR
- result type of collectorpredicate
- a filter function to be applied to the input elementsdownstream
- a collector which will accept filtered values#pairing(Collector, Collector, BiFunction)
public static <T,U,A,R> Collector<T,?,R> mapping(Function<? super T,? extends U> mapper, Collector<? super U,A,R> downstream)
public static <T,U> Collector<T,?,List<U>> flatMapping(Function<? super T,? extends Stream<? extends U>> mapper)
public static <T,U,A,R> Collector<T,?,R> flatMapping(Function<? super T,? extends Stream<? extends U>> mapper, Collector<? super U,A,R> downstream)
public static <T,U> Collector<T,?,List<U>> flattMapping(Function<? super T,? extends Collection<? extends U>> mapper)
public static <T,U,A,R> Collector<T,?,R> flattMapping(Function<? super T,? extends Collection<? extends U>> mapper, Collector<? super U,A,R> downstream)
public static <T,T2,U> Collector<T,?,List<U>> flatMapping(Function<? super T,? extends Stream<? extends T2>> flatMapper, BiFunction<? super T,? super T2,? extends U> mapper)
public static <T,T2,U,A,R> Collector<T,?,R> flatMapping(Function<? super T,? extends Stream<? extends T2>> flatMapper, BiFunction<? super T,? super T2,? extends U> mapper, Collector<? super U,A,R> downstream)
public static <T,T2,U> Collector<T,?,List<U>> flattMapping(Function<? super T,? extends Collection<? extends T2>> flatMapper, BiFunction<? super T,? super T2,? extends U> mapper)
public static <T,T2,U,A,R> Collector<T,?,R> flattMapping(Function<? super T,? extends Collection<? extends T2>> flatMapper, BiFunction<? super T,? super T2,? extends U> mapper, Collector<? super U,A,R> downstream)
public static <T,A,R,RR> Collector<T,A,RR> collectingAndThen(Collector<T,A,R> downstream, Function<R,RR> finisher)
public static <T,A,R,RR> Collector<T,A,RR> collectingAndThen(Collector<T,A,R> downstream, Function<R,RR> finisher)
public static <T> Collector<T,?,List<T>> distinctBy(Function<? super T,?> mapper)
Collector
which collects into the List
the
input elements for which given mapper function returns distinct results.
For ordered source the order of collected elements is preserved. If the same result is returned by mapper function for several elements, only the first element is included into the resulting list.
There are no guarantees on the type, mutability, serializability, or
thread-safety of the List
returned.
The operation performed by the returned collector is equivalent to
stream.distinct(mapper).toList()
, but may work faster.
T
- the type of the input elementsmapper
- a function which classifies input elements.List
.public static <T> Collector<T,?,Integer> distinctCount(Function<? super T,?> mapper)
Collector
which counts a number of distinct values the
mapper function returns for the stream elements.
The operation performed by the returned collector is equivalent to
stream.map(mapper).distinct().count()
. This collector is mostly
useful as a downstream collector.
T
- the type of the input elementsmapper
- a function which classifies input elements.public static <T extends Comparable<? super T>> Collector<T,?,u.Optional<T>> min()
public static <T> Collector<T,?,u.Optional<T>> min(Comparator<? super T> comparator)
public static <T> Collector<T,?,T> minOrGet(Comparator<? super T> comparator, Supplier<? extends T> other)
public static <T,X extends RuntimeException> Collector<T,?,T> minOrThrow(Comparator<? super T> comparator, Supplier<? extends X> exceptionSupplier)
public static <T> Collector<T,?,T> minOrThrow(Comparator<? super T> comparator)
public static <T> Collector<T,?,u.Optional<T>> minBy(Function<? super T,? extends Comparable> keyMapper)
public static <T> Collector<T,?,T> minByOrGet(Function<? super T,? extends Comparable> keyMapper, Supplier<? extends T> other)
public static <T,X extends RuntimeException> Collector<T,?,T> minByOrThrow(Function<? super T,? extends Comparable> keyMapper, Supplier<? extends X> exceptionSupplier)
public static <T> Collector<T,?,T> minByOrThrow(Function<? super T,? extends Comparable> keyMapper)
public static <T> Collector<T,?,u.Optional<T>> maxBy(Function<? super T,? extends Comparable> keyMapper)
public static <T extends Comparable<? super T>> Collector<T,?,T> minForNonEmpty()
public static <T> Collector<T,?,T> minForNonEmpty(Comparator<? super T> comparator)
public static <T extends Comparable<? super T>> Collector<T,?,u.Optional<T>> max()
public static <T> Collector<T,?,u.Optional<T>> max(Comparator<? super T> comparator)
public static <T> Collector<T,?,T> maxOrGet(Comparator<? super T> comparator, Supplier<? extends T> other)
public static <T,X extends RuntimeException> Collector<T,?,T> maxOrThrow(Comparator<? super T> comparator, Supplier<? extends X> exceptionSupplier)
public static <T> Collector<T,?,T> maxOrThrow(Comparator<? super T> comparator)
public static <T> Collector<T,?,T> maxByOrGet(Function<? super T,? extends Comparable> keyMapper, Supplier<? extends T> other)
public static <T,X extends RuntimeException> Collector<T,?,T> maxByOrThrow(Function<? super T,? extends Comparable> keyMapper, Supplier<? extends X> exceptionSupplier)
public static <T> Collector<T,?,T> maxByOrThrow(Function<? super T,? extends Comparable> keyMapper)
public static <T extends Comparable<? super T>> Collector<T,?,T> maxForNonEmpty()
public static <T> Collector<T,?,T> maxForNonEmpty(Comparator<? super T> comparator)
public static <T extends Comparable,R> Collector<T,?,u.Optional<Pair<T,T>>> minMax()
public static <T,R> Collector<T,?,u.Optional<Pair<T,T>>> minMax(Comparator<? super T> comparator)
comparator
- minMax(Comparator, BiFunction)
public static <T,R> Collector<T,?,u.Optional<R>> minMax(Comparator<? super T> comparator, BiFunction<? super T,? super T,? extends R> finisher)
Collector
which finds the minimal and maximal element
according to the supplied comparator, then applies finisher function to
them producing the final result.
This collector produces stable result for ordered stream: if several minimal or maximal elements appear, the collector always selects the first encountered.
If there are no input elements, the finisher method is not called and
empty Optional
is returned. Otherwise the finisher result is
wrapped into Optional
.
T
- the type of the input elementsR
- the type of the result wrapped into Optional
comparator
- comparator which is used to find minimal and maximal
elementfinisher
- a BiFunction
which takes minimal and maximal
element and produces the final result.Collector
which finds minimal and maximal elements.public static <T,R> Collector<T,?,u.Optional<Pair<T,T>>> minMaxBy(Function<? super T,? extends Comparable> keyMapper)
public static <T,R> Collector<T,?,u.Optional<R>> minMaxBy(Function<? super T,? extends Comparable> keyMapper, BiFunction<? super T,? super T,? extends R> finisher)
public static <T extends Comparable<? super T>> Collector<T,?,Pair<T,T>> minMaxForNonEmpty()
public static <T> Collector<T,?,Pair<T,T>> minMaxForNonEmpty(Comparator<? super T> comparator)
public static <T extends Comparable<? super T>> Collector<T,?,List<T>> maxAll()
Collector
which finds all the elements which are equal
to each other and bigger than any other element according to the natural
order. The found elements are collected to List
.T
- the type of the input elementsCollector
which finds all the maximal elements and
collects them to the List
.maxAll(Comparator)
,
maxAll(Collector)
public static <T> Collector<T,?,List<T>> maxAll(Comparator<? super T> comparator)
Collector
which finds all the elements which are equal
to each other and bigger than any other element according to the
specified Comparator
. The found elements are collected to
List
.T
- the type of the input elementscomparator
- a Comparator
to compare the elementsCollector
which finds all the maximal elements and
collects them to the List
.maxAll(Comparator, Collector)
,
maxAll()
public static <T> Collector<T,?,List<T>> maxAll(Comparator<? super T> comparator, int atMostSize)
comparator
- atMostSize
- public static <T extends Comparable<? super T>> Collector<T,?,List<T>> maxAll(boolean areAllLargestSame)
areAllLargestSame = true
(e.g. Number/String/...
) and return a list by repeat the largest object n
times.areAllLargestSame
- maxAll(Comparator, int, boolean)
public static <T extends Comparable<? super T>> Collector<T,?,List<T>> maxAll(int atMostSize, boolean areAllLargestSame)
areAllLargestSame = true
(e.g. Number/String/...
) and return a list by repeat the largest object n
times.atMostSize
- areAllLargestSame
- maxAll(Comparator, int, boolean)
public static <T> Collector<T,?,List<T>> maxAll(Comparator<? super T> comparator, int atMostSize, boolean areAllLargestSame)
areAllLargestSame = true
(e.g. Number/String/...
) and return a list by repeat the largest object n
times.
The default implementation is equivalent to, for this map
:
if (areAllLargestSame) {
final Function, Integer>, List> finisher = new Function, Integer>, List>() {
atMostSize
- areAllLargestSame
- public static <T extends Comparable,A,D> Collector<T,?,D> maxAll(Collector<T,A,D> downstream)
Collector
which finds all the elements which are equal
to each other and bigger than any other element according to the natural
order. The found elements are reduced using the specified downstream
Collector
.T
- the type of the input elementsA
- the intermediate accumulation type of the downstream collectorD
- the result type of the downstream reductiondownstream
- a Collector
implementing the downstream
reductionCollector
which finds all the maximal elements.maxAll(Comparator, Collector)
,
maxAll(Comparator)
,
maxAll()
public static <T,A,D> Collector<T,?,D> maxAll(Comparator<? super T> comparator, Collector<? super T,A,D> downstream)
Collector
which finds all the elements which are equal
to each other and bigger than any other element according to the
specified Comparator
. The found elements are reduced using the
specified downstream Collector
.T
- the type of the input elementsA
- the intermediate accumulation type of the downstream collectorD
- the result type of the downstream reductioncomparator
- a Comparator
to compare the elementsdownstream
- a Collector
implementing the downstream
reductionCollector
which finds all the maximal elements.maxAll(Comparator)
,
maxAll(Collector)
,
maxAll()
public static <T extends Comparable,A,D> Collector<T,?,Pair<u.Optional<T>,D>> maxAlll(Collector<T,A,D> downstream)
public static <T,A,D> Collector<T,?,Pair<u.Optional<T>,D>> maxAlll(Comparator<? super T> comparator, Collector<? super T,A,D> downstream)
public static <T,A,D,R> Collector<T,?,R> maxAlll(Comparator<? super T> comparator, Collector<? super T,A,D> downstream, Function<Pair<u.Optional<T>,D>,R> finisher)
public static <T extends Comparable<? super T>> Collector<T,?,List<T>> minAll()
Collector
which finds all the elements which are equal
to each other and smaller than any other element according to the natural
order. The found elements are collected to List
.T
- the type of the input elementsCollector
which finds all the minimal elements and
collects them to the List
.minAll(Comparator)
,
minAll(Collector)
public static <T> Collector<T,?,List<T>> minAll(Comparator<? super T> comparator)
Collector
which finds all the elements which are equal
to each other and smaller than any other element according to the
specified Comparator
. The found elements are collected to
List
.T
- the type of the input elementscomparator
- a Comparator
to compare the elementsCollector
which finds all the minimal elements and
collects them to the List
.minAll(Comparator, Collector)
,
minAll()
public static <T> Collector<T,?,List<T>> minAll(Comparator<? super T> comparator, int atMostSize)
comparator
- atMostSize
- public static <T extends Comparable<? super T>> Collector<T,?,List<T>> minAll(boolean areAllSmallestSame)
areAllSmallestSame = true
(e.g. Number/String/...
) and return a list by repeat the smallest object n
times.areAllSmallestSame
- maxAll(Comparator, int, boolean)
public static <T extends Comparable<? super T>> Collector<T,?,List<T>> minAll(int atMostSize, boolean areAllSmallestSame)
areAllSmallestSame = true
(e.g. Number/String/...
) and return a list by repeat the smallest object n
times.atMostSize
- areAllSmallestSame
- maxAll(Comparator, int, boolean)
public static <T> Collector<T,?,List<T>> minAll(Comparator<? super T> comparator, int atMostSize, boolean areAllSmallestSame)
areAllSmallestSame = true
(e.g. Number/String/...
) and return a list by repeat the smallest object n
times.comparator
- atMostSize
- areAllSmallestSame
- maxAll(Comparator, int, boolean)
public static <T extends Comparable,A,D> Collector<T,?,D> minAll(Collector<T,A,D> downstream)
Collector
which finds all the elements which are equal
to each other and smaller than any other element according to the natural
order. The found elements are reduced using the specified downstream
Collector
.T
- the type of the input elementsA
- the intermediate accumulation type of the downstream collectorD
- the result type of the downstream reductiondownstream
- a Collector
implementing the downstream
reductionCollector
which finds all the minimal elements.minAll(Comparator, Collector)
,
minAll(Comparator)
,
minAll()
public static <T,A,D> Collector<T,?,D> minAll(Comparator<? super T> comparator, Collector<T,A,D> downstream)
Collector
which finds all the elements which are equal
to each other and smaller than any other element according to the
specified Comparator
. The found elements are reduced using the
specified downstream Collector
.T
- the type of the input elementsA
- the intermediate accumulation type of the downstream collectorD
- the result type of the downstream reductioncomparator
- a Comparator
to compare the elementsdownstream
- a Collector
implementing the downstream
reductionCollector
which finds all the minimal elements.minAll(Comparator)
,
minAll(Collector)
,
minAll()
public static <T extends Comparable,A,D> Collector<T,?,Pair<u.Optional<T>,D>> minAlll(Collector<T,A,D> downstream)
public static <T,A,D> Collector<T,?,Pair<u.Optional<T>,D>> minAlll(Comparator<? super T> comparator, Collector<? super T,A,D> downstream)
public static <T,A,D,R> Collector<T,?,R> minAlll(Comparator<? super T> comparator, Collector<? super T,A,D> downstream, Function<Pair<u.Optional<T>,D>,R> finisher)
public static <T> Collector<T,?,Long> summingInt(ToIntFunction<? super T> mapper)
public static <T> Collector<T,?,Long> summingLong(ToLongFunction<? super T> mapper)
public static <T> Collector<T,?,Double> summingDouble(ToDoubleFunction<? super T> mapper)
public static <T> Collector<T,?,BigInteger> summingBigInteger(Function<? super T,BigInteger> mapper)
public static <T> Collector<T,?,BigDecimal> summingBigDecimal(Function<? super T,BigDecimal> mapper)
public static <T> Collector<T,?,u.OptionalDouble> averagingInt(ToIntFunction<? super T> mapper)
public static <T> Collector<T,?,Double> averagingIntForNonEmpty(ToIntFunction<? super T> mapper)
public static <T> Collector<T,?,u.OptionalDouble> averagingLong(ToLongFunction<? super T> mapper)
public static <T> Collector<T,?,Double> averagingLongForNonEmpty(ToLongFunction<? super T> mapper)
public static <T> Collector<T,?,u.OptionalDouble> averagingDouble(ToDoubleFunction<? super T> mapper)
public static <T> Collector<T,?,Double> averagingDoubleForNonEmpty(ToDoubleFunction<? super T> mapper)
public static <T> Collector<T,?,u.Optional<BigDecimal>> averagingBigInteger(Function<? super T,BigInteger> mapper)
public static <T> Collector<T,?,BigDecimal> averagingBigIntegerForNonEmpty(Function<? super T,BigInteger> mapper)
public static <T> Collector<T,?,u.Optional<BigDecimal>> averagingBigDecimal(Function<? super T,BigDecimal> mapper)
public static <T> Collector<T,?,BigDecimal> averagingBigDecimalForNonEmpty(Function<? super T,BigDecimal> mapper)
public static <T> Collector<T,?,CharSummaryStatistics> summarizingChar(ToCharFunction<? super T> mapper)
public static <T> Collector<T,?,ByteSummaryStatistics> summarizingByte(ToByteFunction<? super T> mapper)
public static <T> Collector<T,?,ShortSummaryStatistics> summarizingShort(ToShortFunction<? super T> mapper)
public static <T> Collector<T,?,IntSummaryStatistics> summarizingInt(ToIntFunction<? super T> mapper)
public static <T> Collector<T,?,LongSummaryStatistics> summarizingLong(ToLongFunction<? super T> mapper)
public static <T> Collector<T,?,FloatSummaryStatistics> summarizingFloat(ToFloatFunction<? super T> mapper)
public static <T> Collector<T,?,DoubleSummaryStatistics> summarizingDouble(ToDoubleFunction<? super T> mapper)
public static <T> Collector<T,?,T> reducing(T identity, BinaryOperator<T> op)
public static <T> Collector<T,?,u.Optional<T>> reducing(BinaryOperator<T> op)
public static <T> Collector<T,?,T> reducingOrGet(BinaryOperator<T> op, Supplier<? extends T> other)
public static <T,X extends RuntimeException> Collector<T,?,T> reducingOrThrow(BinaryOperator<T> op, Supplier<? extends X> exceptionSupplier)
public static <T> Collector<T,?,T> reducingOrThrow(BinaryOperator<T> op)
public static <T,U> Collector<T,?,U> reducing(U identity, Function<? super T,? extends U> mapper, BinaryOperator<U> op)
public static <T,U> Collector<T,?,u.Optional<U>> reducing(Function<? super T,? extends U> mapper, BinaryOperator<U> op)
public static <T,U> Collector<T,?,U> reducingOrGet(Function<? super T,? extends U> mapper, BinaryOperator<U> op, Supplier<? extends U> other)
public static <T,U,X extends RuntimeException> Collector<T,?,U> reducingOrThrow(Function<? super T,? extends U> mapper, BinaryOperator<U> op, Supplier<? extends X> exceptionSupplier)
public static <T,U> Collector<T,?,U> reducingOrThrow(Function<? super T,? extends U> mapper, BinaryOperator<U> op)
public static Collector<CharSequence,?,String> commonPrefix()
Collector
which computes a common prefix of input
CharSequence
objects returning the result as String
. For
empty input the empty String
is returned.
The returned Collector
handles specially Unicode surrogate pairs:
the returned prefix may end with
Unicode high-surrogate code unit only if it's not succeeded by
Unicode low-surrogate code unit in any of the input sequences.
Normally the ending high-surrogate code unit is removed from the prefix.
This method returns a short-circuiting collector: it may not process all the elements if the common prefix is empty.
Collector
which computes a common prefix.public static Collector<CharSequence,?,String> commonSuffix()
Collector
which computes a common suffix of input
CharSequence
objects returning the result as String
. For
empty input the empty String
is returned.
The returned Collector
handles specially Unicode surrogate pairs:
the returned suffix may start with
Unicode low-surrogate code unit only if it's not preceded by
Unicode high-surrogate code unit in any of the input sequences.
Normally the starting low-surrogate code unit is removed from the suffix.
This method returns a short-circuiting collector: it may not process all the elements if the common suffix is empty.
Collector
which computes a common suffix.public static <T,K> Collector<T,?,Map<K,List<T>>> groupingBy(Function<? super T,? extends K> keyMapper)
public static <T,K,M extends Map<K,List<T>>> Collector<T,?,M> groupingBy(Function<? super T,? extends K> keyMapper, Supplier<? extends M> mapFactory)
public static <T,K,A,D> Collector<T,?,Map<K,D>> groupingBy(Function<? super T,? extends K> keyMapper, Collector<? super T,A,D> downstream)
public static <T,K,A,D,M extends Map<K,D>> Collector<T,?,M> groupingBy(Function<? super T,? extends K> keyMapper, Collector<? super T,A,D> downstream, Supplier<? extends M> mapFactory)
public static <T,K> Collector<T,?,ConcurrentMap<K,List<T>>> groupingByConcurrent(Function<? super T,? extends K> keyMapper)
public static <T,K,M extends ConcurrentMap<K,List<T>>> Collector<T,?,M> groupingByConcurrent(Function<? super T,? extends K> keyMapper, Supplier<? extends M> mapFactory)
public static <T,K,A,D> Collector<T,?,ConcurrentMap<K,D>> groupingByConcurrent(Function<? super T,? extends K> keyMapper, Collector<? super T,A,D> downstream)
public static <T,K,A,D,M extends ConcurrentMap<K,D>> Collector<T,?,M> groupingByConcurrent(Function<? super T,? extends K> keyMapper, Collector<? super T,A,D> downstream, Supplier<? extends M> mapFactory)
public static <T> Collector<T,?,Map<Boolean,List<T>>> partitioningBy(Predicate<? super T> predicate)
public static <T,D,A> Collector<T,?,Map<Boolean,D>> partitioningBy(Predicate<? super T> predicate, Collector<? super T,A,D> downstream)
public static <T,K> Collector<T,?,Map<K,Long>> countingBy(Function<? super T,? extends K> keyMapper)
public static <T,K,M extends Map<K,Long>> Collector<T,?,M> countingBy(Function<? super T,? extends K> keyMapper, Supplier<? extends M> mapFactory)
public static <T,K> Collector<T,?,Map<K,Integer>> countingIntBy(Function<? super T,? extends K> keyMapper)
public static <T,K,M extends Map<K,Integer>> Collector<T,?,M> countingIntBy(Function<? super T,? extends K> keyMapper, Supplier<? extends M> mapFactory)
public static <K,V> Collector<Map.Entry<K,V>,?,Map<K,V>> toMap(BinaryOperator<V> mergeFunction)
public static <K,V,M extends Map<K,V>> Collector<Map.Entry<K,V>,?,M> toMap(Supplier<? extends M> mapFactory)
public static <K,V,M extends Map<K,V>> Collector<Map.Entry<K,V>,?,M> toMap(BinaryOperator<V> mergeFunction, Supplier<? extends M> mapFactory)
public static <T,K,V> Collector<T,?,Map<K,V>> toMap(Function<? super T,? extends K> keyMapper, Function<? super T,? extends V> valueMapper)
public static <T,K,V> Collector<T,?,Map<K,V>> toMap(Function<? super T,? extends K> keyMapper, Function<? super T,? extends V> valueMapper, BinaryOperator<V> mergeFunction)
public static <T,K,V,M extends Map<K,V>> Collector<T,?,M> toMap(Function<? super T,? extends K> keyMapper, Function<? super T,? extends V> valueMapper, Supplier<? extends M> mapFactory)
public static <T,K,V,M extends Map<K,V>> Collector<T,?,M> toMap(Function<? super T,? extends K> keyMapper, Function<? super T,? extends V> valueMapper, BinaryOperator<V> mergeFunction, Supplier<? extends M> mapFactory)
public static <T,K,A,D> Collector<T,?,Map<K,D>> toMap(Function<? super T,? extends K> keyMapper, Collector<? super T,A,D> downstream)
keyMapper
- downstream
- groupingBy(Function, Collector)
public static <T,K,A,D,M extends Map<K,D>> Collector<T,?,M> toMap(Function<? super T,? extends K> keyMapper, Collector<? super T,A,D> downstream, Supplier<? extends M> mapFactory)
keyMapper
- downstream
- mapFactory
- groupingBy(Function, Collector, Supplier)
public static <T,K,V,A,D> Collector<T,?,Map<K,D>> toMap(Function<? super T,? extends K> keyMapper, Function<? super T,? extends V> valueMapper, Collector<? super V,A,D> downstream)
keyMapper
- valueMapper
- downstream
- groupingBy(Function, Collector)
public static <T,K,V,A,D,M extends Map<K,D>> Collector<T,?,M> toMap(Function<? super T,? extends K> keyMapper, Function<? super T,? extends V> valueMapper, Collector<? super V,A,D> downstream, Supplier<? extends M> mapFactory)
keyMapper
- valueMapper
- downstream
- mapFactory
- groupingBy(Function, Collector, Supplier)
public static <K,V> Collector<Map.Entry<K,V>,?,ImmutableMap<K,V>> toImmutableMap()
public static <K,V> Collector<Map.Entry<K,V>,?,ImmutableMap<K,V>> toImmutableMap(BinaryOperator<V> mergeFunction)
public static <T,K,V> Collector<T,?,ImmutableMap<K,V>> toImmutableMap(Function<? super T,? extends K> keyMapper, Function<? super T,? extends V> valueMapper)
public static <T,K,V> Collector<T,?,ImmutableMap<K,V>> toImmutableMap(Function<? super T,? extends K> keyMapper, Function<? super T,? extends V> valueMapper, BinaryOperator<V> mergeFunction)
public static <T,K,V> Collector<T,?,Map<K,V>> toLinkedHashMap(Function<? super T,? extends K> keyMapper, Function<? super T,? extends V> valueMapper)
keyMapper
- valueMapper
- toMap(Function, Function)
public static <T,K,V> Collector<T,?,Map<K,V>> toLinkedHashMap(Function<? super T,? extends K> keyMapper, Function<? super T,? extends V> valueMapper, BinaryOperator<V> mergeFunction)
keyMapper
- valueMapper
- mergeFunction
- toMap(Function, Function, BinaryOperator)
public static <T,K,V> Collector<T,?,ConcurrentMap<K,V>> toConcurrentMap(Function<? super T,? extends K> keyMapper, Function<? super T,? extends V> valueMapper)
public static <T,K,V,M extends ConcurrentMap<K,V>> Collector<T,?,M> toConcurrentMap(Function<? super T,? extends K> keyMapper, Function<? super T,? extends V> valueMapper, Supplier<? extends M> mapFactory)
public static <T,K,V> Collector<T,?,ConcurrentMap<K,V>> toConcurrentMap(Function<? super T,? extends K> keyMapper, Function<? super T,? extends V> valueMapper, BinaryOperator<V> mergeFunction)
public static <T,K,V,M extends ConcurrentMap<K,V>> Collector<T,?,M> toConcurrentMap(Function<? super T,? extends K> keyMapper, Function<? super T,? extends V> valueMapper, BinaryOperator<V> mergeFunction, Supplier<? extends M> mapFactory)
public static <T,K,V> Collector<T,?,BiMap<K,V>> toBiMap(Function<? super T,? extends K> keyMapper, Function<? super T,? extends V> valueMapper)
public static <T,K,V> Collector<T,?,BiMap<K,V>> toBiMap(Function<? super T,? extends K> keyMapper, Function<? super T,? extends V> valueMapper, Supplier<BiMap<K,V>> mapFactory)
public static <T,K,V> Collector<T,?,BiMap<K,V>> toBiMap(Function<? super T,? extends K> keyMapper, Function<? super T,? extends V> valueMapper, BinaryOperator<V> mergeFunction)
public static <T,K,V> Collector<T,?,BiMap<K,V>> toBiMap(Function<? super T,? extends K> keyMapper, Function<? super T,? extends V> valueMapper, BinaryOperator<V> mergeFunction, Supplier<BiMap<K,V>> mapFactory)
public static <K,V> Collector<Map.Entry<? extends K,? extends V>,?,ListMultimap<K,V>> toMultimap()
public static <K,V,C extends Collection<V>,M extends Multimap<K,V,C>> Collector<Map.Entry<? extends K,? extends V>,?,M> toMultimap(Supplier<? extends M> mapFactory)
public static <T,K> Collector<T,?,ListMultimap<K,T>> toMultimap(Function<? super T,? extends K> keyMapper)
public static <T,K,C extends Collection<T>,M extends Multimap<K,T,C>> Collector<T,?,M> toMultimap(Function<? super T,? extends K> keyMapper, Supplier<? extends M> mapFactory)
public static <T,K,V> Collector<T,?,ListMultimap<K,V>> toMultimap(Function<? super T,? extends K> keyMapper, Function<? super T,? extends V> valueMapper)
public static <T,K,V,C extends Collection<V>,M extends Multimap<K,V,C>> Collector<T,?,M> toMultimap(Function<? super T,? extends K> keyMapper, Function<? super T,? extends V> valueMapper, Supplier<? extends M> mapFactory)
public static <T,K,V> Collector<T,?,ListMultimap<K,V>> flatMappingValueToMultimap(Function<? super T,K> keyMapper, Function<? super T,? extends Stream<? extends V>> flatValueMapper)
keyMapper
- flatValueMapper
- toMultimap(Function, Function)
public static <T,K,V,C extends Collection<V>,M extends Multimap<K,V,C>> Collector<T,?,M> flatMappingValueToMultimap(Function<? super T,K> keyMapper, Function<? super T,? extends Stream<? extends V>> flatValueMapper, Supplier<? extends M> mapFactory)
keyMapper
- flatValueMapper
- mapFactory
- toMultimap(Function, Function, Supplier)
public static <T,K,V> Collector<T,?,ListMultimap<K,V>> flattMappingValueToMultimap(Function<? super T,K> keyMapper, Function<? super T,? extends Collection<? extends V>> flatValueMapper)
keyMapper
- flatValueMapper
- toMultimap(Function, Function)
public static <T,K,V,C extends Collection<V>,M extends Multimap<K,V,C>> Collector<T,?,M> flattMappingValueToMultimap(Function<? super T,K> keyMapper, Function<? super T,? extends Collection<? extends V>> flatValueMapper, Supplier<? extends M> mapFactory)
keyMapper
- flatValueMapper
- mapFactory
- toMultimap(Function, Function, Supplier)
public static <T,K,V> Collector<T,?,ListMultimap<K,V>> flatMappingKeyToMultimap(Function<? super T,Stream<? extends K>> flatKeyMapper, Function<? super T,V> valueMapper)
flatKeyMapper
- valueMapper
- toMultimap(Function, Function)
public static <T,K,V,C extends Collection<V>,M extends Multimap<K,V,C>> Collector<T,?,M> flatMappingKeyToMultimap(Function<? super T,Stream<? extends K>> flatKeyMapper, Function<? super T,V> valueMapper, Supplier<? extends M> mapFactory)
flatKeyMapper
- valueMapper
- mapFactory
- toMultimap(Function, Function, Supplier)
public static <T,K,V> Collector<T,?,ListMultimap<K,V>> flattMappingKeyToMultimap(Function<? super T,? extends Collection<? extends K>> flatKeyMapper, Function<? super T,V> valueMapper)
flatKeyMapper
- valueMapper
- toMultimap(Function, Function)
public static <T,K,V,C extends Collection<V>,M extends Multimap<K,V,C>> Collector<T,?,M> flattMappingKeyToMultimap(Function<? super T,? extends Collection<? extends K>> flatKeyMapper, Function<? super T,V> valueMapper, Supplier<? extends M> mapFactory)
flatKeyMapper
- valueMapper
- mapFactory
- toMultimap(Function, Function, Supplier)
public static <T,A1,A2,R1,R2> Collector<T,Tuple.Tuple2<A1,A2>,Tuple.Tuple2<R1,R2>> combine(Collector<? super T,A1,R1> collector1, Collector<? super T,A2,R2> collector2)
public static <T,A1,A2,R1,R2,R> Collector<T,Tuple.Tuple2<A1,A2>,R> combine(Collector<? super T,A1,R1> collector1, Collector<? super T,A2,R2> collector2, BiFunction<? super R1,? super R2,R> finisher)
public static <T,A1,A2,A3,R1,R2,R3> Collector<T,Tuple.Tuple3<A1,A2,A3>,Tuple.Tuple3<R1,R2,R3>> combine(Collector<? super T,A1,R1> collector1, Collector<? super T,A2,R2> collector2, Collector<? super T,A3,R3> collector3)
public static <T,A1,A2,A3,R1,R2,R3,R> Collector<T,Tuple.Tuple3<A1,A2,A3>,R> combine(Collector<? super T,A1,R1> collector1, Collector<? super T,A2,R2> collector2, Collector<? super T,A3,R3> collector3, TriFunction<? super R1,? super R2,? super R3,R> finisher)
public static <T,A1,A2,A3,A4,R1,R2,R3,R4> Collector<T,Tuple.Tuple4<A1,A2,A3,A4>,Tuple.Tuple4<R1,R2,R3,R4>> combine(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 static <T,A1,A2,A3,A4,A5,R1,R2,R3,R4,R5> Collector<T,Tuple.Tuple5<A1,A2,A3,A4,A5>,Tuple.Tuple5<R1,R2,R3,R4,R5>> combine(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 static <T> Collector<T,?,List<?>> combine(List<? extends Collector<? super T,?,?>> collectors)
collectors
- Tuple.from(Collection)
public static <T,A1,A2,R1,R2> Collector<T,Tuple.Tuple2<A1,A2>,Tuple.Tuple2<R1,R2>> combine(Collector<? super T,A1,R1> collector1, Collector<? super T,A2,R2> collector2)
public static <T,A1,A2,R1,R2,R> Collector<T,Tuple.Tuple2<A1,A2>,R> combine(Collector<? super T,A1,R1> collector1, Collector<? super T,A2,R2> collector2, BiFunction<? super R1,? super R2,R> finisher)
public static <T,A1,A2,A3,R1,R2,R3> Collector<T,Tuple.Tuple3<A1,A2,A3>,Tuple.Tuple3<R1,R2,R3>> combine(Collector<? super T,A1,R1> collector1, Collector<? super T,A2,R2> collector2, Collector<? super T,A3,R3> collector3)
public static <T,A1,A2,A3,R1,R2,R3,R> Collector<T,Tuple.Tuple3<A1,A2,A3>,R> combine(Collector<? super T,A1,R1> collector1, Collector<? super T,A2,R2> collector2, Collector<? super T,A3,R3> collector3, TriFunction<? super R1,? super R2,? super R3,R> finisher)
public static <T,A1,A2,A3,A4,R1,R2,R3,R4> Collector<T,Tuple.Tuple4<A1,A2,A3,A4>,Tuple.Tuple4<R1,R2,R3,R4>> combine(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 static <T,A1,A2,A3,A4,A5,R1,R2,R3,R4,R5> Collector<T,Tuple.Tuple5<A1,A2,A3,A4,A5>,Tuple.Tuple5<R1,R2,R3,R4,R5>> combine(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 static <T> Collector<T,?,List<?>> combine(Collection<? extends Collector<? super T,?,?>> collectors)
collectors
- Tuple.from(Collection)
@Deprecated public static <T,R> Collector<T,?,R> streaming(Function<? super Stream<T>,R> streamingCollector)
Collectors
.streamingCollector
- Stream#observe(BlockingQueue, Predicate, long)
,
Stream.asyncCall(Throwables.Function)
@Deprecated public static <T,R> Collector<T,?,R> streaming(long maxWaitIntervalInMillis, Function<? super Stream<T>,R> streamingCollector)
Collectors
.maxWaitIntervalInMillis
- streamingCollector
- Stream#observe(BlockingQueue, Predicate, long)
,
Stream.asyncCall(Throwables.Function)
@Deprecated public static <T,R> Collector<T,?,R> streaming(Supplier<? extends BlockingQueue<T>> queueSupplier, Function<? super Stream<T>,R> streamingCollector)
Collectors
.supplier
- streamingCollector
- Stream#observe(BlockingQueue, Predicate, long)
,
Stream.asyncCall(Throwables.Function)
@Deprecated public static <T,R> Collector<T,?,R> streaming(long maxWaitIntervalInMillis, Supplier<? extends BlockingQueue<T>> queueSupplier, Function<? super Stream<T>,R> streamingCollector)
Collectors
.maxWaitIntervalInMillis
- supplier
- streamingCollector
- Stream#observe(BlockingQueue, Predicate, long)
,
Stream.asyncCall(Throwables.Function)
@Deprecated public static <T,R> Collector<T,?,R> streaming(Supplier<? extends BlockingQueue<T>> queueSupplier, Function<? super Stream<T>,ContinuableFuture<R>> streamingCollector, long maxWaitIntervalInMillis)
Collectors
.supplier
- streamingCollector
- maxWaitIntervalInMillis
- Stream#observe(BlockingQueue, Predicate, long)
,
Stream.asyncCall(Throwables.Function)
Copyright © 2020. All rights reserved.