Package org.n52.janmayen.stream
Class MoreCollectors
java.lang.Object
org.n52.janmayen.stream.MoreCollectors
TODO JavaDoc
-
Method Summary
Modifier and TypeMethodDescriptionstatic <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> 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) 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>
Collector<T, ?, X> toCompositeException(Supplier<X> supplier, ThrowingConsumer<? super T, E> fun) static <T,E extends Exception>
Collector<T, ?, CompositeException> toCompositeException(ThrowingConsumer<? super T, E> fun) toDuplicateSet(int min) toDuplicateStream(int min) static <K,V> Collector <Map.Entry<K, V>, ?, LinkedHashMap<K, V>> static <T> Collector<T, ?, T> static <T> Collector<T, ?, T> toSingleResult(Supplier<? extends RuntimeException> exceptionSupplier) Returns aCollectorthat accumulates the input elements into a new unmodifiableList.Returns aCollectorthat accumulates the input elements into a new unmodifiableSet.
-
Method Details
-
toUnmodifiableSet
Returns aCollectorthat accumulates the input elements into a new unmodifiableSet.- Type Parameters:
T- the element type- Returns:
- the collector
-
toUnmodifiableList
Returns aCollectorthat accumulates the input elements into a new unmodifiableList.- Type Parameters:
T- the element type- Returns:
- the collector
-
filtering
-
flatMapping
-
toCardinalities
-
toChain
-
toChain
-
toDuplicateSet
-
toDuplicateSet
-
toDuplicateStream
-
toDuplicateStream
-
toSingleResult
-
toSingleResult
public static <T> Collector<T,?, toSingleResultT> (Supplier<? extends RuntimeException> exceptionSupplier) -
toValueMap
-
toLinkedHashMap
-
collector
public static <T,R> Collector<T,?, collectorR> (Supplier<R> supplier, BiConsumer<R, T> accumulator, BiConsumer<R, R> combiner) -
collector
public static <T,A, Collector<T,R> ?, collectorR> (Supplier<A> supplier, BiConsumer<A, T> accumulator, BiConsumer<A, A> combiner, Function<A, R> finisher) -
toCompositeException
public static <T,E extends Exception> Collector<T,?, toCompositeExceptionCompositeException> (ThrowingConsumer<? super T, E> fun) -
toCompositeException
public static <T,E extends Exception, Collector<T,X extends CompositeException> ?, toCompositeExceptionX> (Supplier<X> supplier, ThrowingConsumer<? super T, E> fun)
-