Class GuavaCollectors


  • public final class GuavaCollectors
    extends Object
    • Method Summary

      All Methods Static Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      static <T> Collector<T,​?,​com.google.common.collect.ImmutableList<T>> toImmutableList()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Use ImmutableList.toImmutableList() instead.
      static <T,​K,​U>
      Collector<T,​com.google.common.collect.ImmutableListMultimap.Builder<K,​U>,​com.google.common.collect.ImmutableListMultimap<K,​U>>
      toImmutableListMultimap​(Function<? super T,​? extends K> keyMapper, Function<? super T,​? extends List<U>> valueMapper)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Use ImmutableListMultimap.toImmutableListMultimap(Function, Function) instead.
      static <T,​K,​U>
      Collector<T,​?,​com.google.common.collect.ImmutableMap<K,​U>>
      toImmutableMap​(Function<? super T,​? extends K> keyMapper, Function<? super T,​? extends U> valueMapper)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Use ImmutableMap.toImmutableMap(Function, Function) instead.
      static <T> Collector<T,​?,​com.google.common.collect.ImmutableSet<T>> toImmutableSet()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Use ImmutableSet.toImmutableSet() instead.
      static <T,​K,​U>
      Collector<T,​com.google.common.collect.ImmutableSetMultimap.Builder<K,​U>,​com.google.common.collect.ImmutableSetMultimap<K,​U>>
      toImmutableSetMultimap​(Function<? super T,​? extends K> keyMapper, Function<? super T,​? extends Set<U>> valueMapper)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Use ImmutableSetMultimap.toImmutableSetMultimap(Function, Function) instead.
    • Method Detail

      • toImmutableList

        @Deprecated(forRemoval=true)
        public static <T> Collector<T,​?,​com.google.common.collect.ImmutableList<T>> toImmutableList()
        Deprecated, for removal: This API element is subject to removal in a future version.
        Use ImmutableList.toImmutableList() instead.
      • toImmutableSet

        @Deprecated(forRemoval=true)
        public static <T> Collector<T,​?,​com.google.common.collect.ImmutableSet<T>> toImmutableSet()
        Deprecated, for removal: This API element is subject to removal in a future version.
        Use ImmutableSet.toImmutableSet() instead.
      • toImmutableMap

        @Deprecated(forRemoval=true)
        public static <T,​K,​U> Collector<T,​?,​com.google.common.collect.ImmutableMap<K,​U>> toImmutableMap​(Function<? super T,​? extends K> keyMapper,
                                                                                                                                      Function<? super T,​? extends U> valueMapper)
        Deprecated, for removal: This API element is subject to removal in a future version.
        Use ImmutableMap.toImmutableMap(Function, Function) instead.
      • toImmutableListMultimap

        @Deprecated(forRemoval=true)
        public static <T,​K,​U> Collector<T,​com.google.common.collect.ImmutableListMultimap.Builder<K,​U>,​com.google.common.collect.ImmutableListMultimap<K,​U>> toImmutableListMultimap​(Function<? super T,​? extends K> keyMapper,
                                                                                                                                                                                                                         Function<? super T,​? extends List<U>> valueMapper)
        Deprecated, for removal: This API element is subject to removal in a future version.
        Use ImmutableListMultimap.toImmutableListMultimap(Function, Function) instead. This will require some refactoring as it expects the value mapper to map one value instead of a list.
      • toImmutableSetMultimap

        @Deprecated(forRemoval=true)
        public static <T,​K,​U> Collector<T,​com.google.common.collect.ImmutableSetMultimap.Builder<K,​U>,​com.google.common.collect.ImmutableSetMultimap<K,​U>> toImmutableSetMultimap​(Function<? super T,​? extends K> keyMapper,
                                                                                                                                                                                                                      Function<? super T,​? extends Set<U>> valueMapper)
        Deprecated, for removal: This API element is subject to removal in a future version.
        Use ImmutableSetMultimap.toImmutableSetMultimap(Function, Function) instead. This will require some refactoring as it expects the value mapper to map one value instead of a list.