Package com.github.phantomthief.util
Class MoreCollectors
- java.lang.Object
-
- com.github.phantomthief.util.MoreCollectors
-
public final class MoreCollectors extends Object
- Author:
- w.vela
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classMoreCollectors.CollectorImpl<T,A,R>Simple implementation class forCollector.
-
Field Summary
Fields Modifier and Type Field Description static Set<Collector.Characteristics>CH_IDstatic Set<Collector.Characteristics>CH_NOID
-
Method Summary
All Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static <T> Collector<T,?,Stream<T>>concat(Stream<? extends T> other)static <T> Collector<T,?,Stream<T>>concat(T element)static <T,K>
Collector<T,?,Map<K,List<T>>>groupingByAllowNullKey(Function<? super T,? extends K> classifier)static <T,K,D,A,M extends Map<K,D>>
Collector<T,?,M>groupingByAllowNullKey(Function<? super T,? extends K> classifier, Supplier<M> mapFactory, Collector<? super T,A,D> downstream)allow null key for mapFactory, nothing else changesstatic <T,K,A,D>
Collector<T,?,Map<K,D>>groupingByAllowNullKey(Function<? super T,? extends K> classifier, Collector<? super T,A,D> downstream)static <T> BinaryOperator<T>throwingMerger()static Collector<Integer,?,com.carrotsearch.hppc.IntArrayList>toIntList()static <T,K,U>
Collector<T,com.carrotsearch.hppc.IntObjectHashMap<U>,com.carrotsearch.hppc.IntObjectHashMap<U>>toIntMap(ToIntFunction<? super T> keyMapper, Function<? super T,? extends U> valueMapper)static Collector<Integer,?,com.carrotsearch.hppc.IntHashSet>toIntSet()static Collector<Long,?,com.carrotsearch.hppc.LongArrayList>toLongList()static Collector<Long,?,com.carrotsearch.hppc.LongHashSet>toLongSet()static <K,V>
Collector<Map.Entry<K,V>,?,Map<K,V>>toMap()static <T,K,U,R extends Map<K,U>>
Collector<T,?,R>toMap(Function<? super T,? extends K> keyMapper, Function<? super T,? extends U> valueMapper, Supplier<R> supplier)static <T,K,U,M extends com.google.common.collect.Multimap<K,U>>
Collector<T,?,M>toMultimap(Function<? super T,? extends K> keyMapper, Function<? super T,? extends U> valueMapper, Supplier<M> supplier)Deprecated.static <T,K>
Collector<T,?,com.google.common.collect.HashMultiset<K>>toMultiset(Function<? super T,? extends K> elementMapper, ToIntFunction<? super T> countMapper)Deprecated.
-
-
-
Field Detail
-
CH_ID
public static final Set<Collector.Characteristics> CH_ID
-
CH_NOID
public static final Set<Collector.Characteristics> CH_NOID
-
-
Method Detail
-
toIntMap
public static <T,K,U> Collector<T,com.carrotsearch.hppc.IntObjectHashMap<U>,com.carrotsearch.hppc.IntObjectHashMap<U>> toIntMap(ToIntFunction<? super T> keyMapper, Function<? super T,? extends U> valueMapper)
-
toMultiset
@Deprecated public static <T,K> Collector<T,?,com.google.common.collect.HashMultiset<K>> toMultiset(Function<? super T,? extends K> elementMapper, ToIntFunction<? super T> countMapper)
Deprecated.
-
toMultimap
@Deprecated public static <T,K,U,M extends com.google.common.collect.Multimap<K,U>> Collector<T,?,M> toMultimap(Function<? super T,? extends K> keyMapper, Function<? super T,? extends U> valueMapper, Supplier<M> supplier)
Deprecated.useMultimaps.toMultimap(Function, Function, Supplier)if using guava 21.0+
-
toMap
public static <T,K,U,R extends Map<K,U>> Collector<T,?,R> toMap(Function<? super T,? extends K> keyMapper, Function<? super T,? extends U> valueMapper, Supplier<R> supplier)
-
groupingByAllowNullKey
public static <T,K> Collector<T,?,Map<K,List<T>>> groupingByAllowNullKey(Function<? super T,? extends K> classifier)
-
groupingByAllowNullKey
public static <T,K,A,D> Collector<T,?,Map<K,D>> groupingByAllowNullKey(Function<? super T,? extends K> classifier, Collector<? super T,A,D> downstream)
-
groupingByAllowNullKey
public static <T,K,D,A,M extends Map<K,D>> Collector<T,?,M> groupingByAllowNullKey(Function<? super T,? extends K> classifier, Supplier<M> mapFactory, Collector<? super T,A,D> downstream)
allow null key for mapFactory, nothing else changes
-
throwingMerger
public static <T> BinaryOperator<T> throwingMerger()
-
-