public final class MoreCollectors extends Object
| Modifier and Type | Method and Description |
|---|---|
static <T,A,R> Collector<T,?,R> |
collector(Supplier<A> supplier,
BiConsumer<A,T> accumulator,
BiConsumer<A,A> combiner,
Function<A,R> finisher) |
static <T,R> Collector<T,?,R> |
collector(Supplier<R> supplier,
BiConsumer<R,T> accumulator,
BiConsumer<R,R> combiner) |
static <T,A,R> Collector<T,A,R> |
filtering(Predicate<T> filter,
Collector<T,A,R> downstream) |
static <T,U,A,R> Collector<T,?,R> |
flatMapping(Function<? super T,? extends Stream<? extends U>> mapper,
Collector<? super U,A,R> downstream) |
static <X,T> Collector<X,?,Map<Chain<T>,BigInteger>> |
toCardinalities(Function<X,T> id,
Predicate<X> hasSubElements,
Function<X,Stream<X>> subElements) |
static <X,T> Collector<X,?,Map<Chain<T>,X>> |
toChain(Function<X,T> id,
Predicate<X> hasSubElements,
Function<X,Stream<X>> subElements) |
static <X,T,U> Collector<X,?,Map<Chain<T>,U>> |
toChain(Function<X,T> id,
Predicate<X> hasSubElements,
Function<X,Stream<X>> subElements,
Function<X,U> finisher) |
static <T,E extends Exception,X extends CompositeException> |
toCompositeException(Supplier<X> supplier,
ThrowingConsumer<? super T,E> fun) |
static <T,E extends Exception> |
toCompositeException(ThrowingConsumer<? super T,E> fun) |
static <X> Collector<X,?,Set<X>> |
toDuplicateSet() |
static <X> Collector<X,?,Set<X>> |
toDuplicateSet(int min) |
static <X> Collector<X,?,Stream<X>> |
toDuplicateStream() |
static <X> Collector<X,?,Stream<X>> |
toDuplicateStream(int min) |
static <K,V> Collector<Map.Entry<K,V>,?,LinkedHashMap<K,V>> |
toLinkedHashMap() |
static <T> Collector<T,?,T> |
toSingleResult() |
static <T> Collector<T,?,T> |
toSingleResult(Supplier<? extends RuntimeException> exceptionSupplier) |
static <T> Collector<T,?,List<T>> |
toUnmodifiableList()
Returns a
Collector that accumulates the input elements into a new unmodifiable List. |
static <T> Collector<T,?,Set<T>> |
toUnmodifiableSet()
Returns a
Collector that accumulates the input elements into a new unmodifiable Set. |
static <K,V> Collector<Map.Entry<K,V>,?,Map<V,K>> |
toValueMap() |
public static <T> Collector<T,?,Set<T>> toUnmodifiableSet()
Collector that accumulates the input elements into a new unmodifiable Set.T - the element typepublic static <T> Collector<T,?,List<T>> toUnmodifiableList()
Collector that accumulates the input elements into a new unmodifiable List.T - the element typepublic static <T,A,R> Collector<T,A,R> filtering(Predicate<T> filter, Collector<T,A,R> downstream)
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 <X,T> Collector<X,?,Map<Chain<T>,BigInteger>> toCardinalities(Function<X,T> id, Predicate<X> hasSubElements, Function<X,Stream<X>> subElements)
public static <X,T> Collector<X,?,Map<Chain<T>,X>> toChain(Function<X,T> id, Predicate<X> hasSubElements, Function<X,Stream<X>> subElements)
public static <X,T,U> Collector<X,?,Map<Chain<T>,U>> toChain(Function<X,T> id, Predicate<X> hasSubElements, Function<X,Stream<X>> subElements, Function<X,U> finisher)
public static <T> Collector<T,?,T> toSingleResult()
public static <T> Collector<T,?,T> toSingleResult(Supplier<? extends RuntimeException> exceptionSupplier)
public static <K,V> Collector<Map.Entry<K,V>,?,LinkedHashMap<K,V>> toLinkedHashMap()
public static <T,R> Collector<T,?,R> collector(Supplier<R> supplier, BiConsumer<R,T> accumulator, BiConsumer<R,R> combiner)
public static <T,A,R> Collector<T,?,R> collector(Supplier<A> supplier, BiConsumer<A,T> accumulator, BiConsumer<A,A> combiner, Function<A,R> finisher)
public static <T,E extends Exception> Collector<T,?,CompositeException> toCompositeException(ThrowingConsumer<? super T,E> fun)
public static <T,E extends Exception,X extends CompositeException> Collector<T,?,X> toCompositeException(Supplier<X> supplier, ThrowingConsumer<? super T,E> fun)
Copyright © 2015–2020 52°North Initiative for Geospatial Open Source Software GmbH. All rights reserved.