Class MoreCollectors


  • public final class MoreCollectors
    extends Object
    Author:
    w.vela
    • Method Detail

      • toIntList

        public static Collector<Integer,​?,​com.carrotsearch.hppc.IntArrayList> toIntList()
      • toLongList

        public static Collector<Long,​?,​com.carrotsearch.hppc.LongArrayList> toLongList()
      • toIntSet

        public static Collector<Integer,​?,​com.carrotsearch.hppc.IntHashSet> toIntSet()
      • toLongSet

        public static Collector<Long,​?,​com.carrotsearch.hppc.LongHashSet> toLongSet()
      • 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.
        use Multimaps.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()
      • concat

        public static <T> Collector<T,​?,​Stream<T>> concat​(T element)