Class GuavaCollectors


  • public final class GuavaCollectors
    extends java.lang.Object
    Implementations of Collector that implement various useful reduction operations, such as accumulating elements into Guava collections.
    • Method Summary

      All Methods Static Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      static <T> java.util.stream.Collector<T,​com.google.common.collect.ImmutableList.Builder<T>,​com.google.common.collect.ImmutableList<T>> toImmutableList()
      Deprecated.
      in 1.11.0 consider using ImmutableList.toImmutableList() instead.
      static <T> java.util.stream.Collector<T,​com.google.common.collect.ImmutableSet.Builder<T>,​com.google.common.collect.ImmutableSet<T>> toImmutableSet()
      Deprecated.
      in 1.11.0 consider using ImmutableSet.toImmutableSet() instead.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • toImmutableSet

        @Deprecated
        public static <T> java.util.stream.Collector<T,​com.google.common.collect.ImmutableSet.Builder<T>,​com.google.common.collect.ImmutableSet<T>> toImmutableSet()
        Deprecated.
        in 1.11.0 consider using ImmutableSet.toImmutableSet() instead.
        Returns a Collector that accumulates the input elements into a new ImmutableSet.
        Type Parameters:
        T - type
        Returns:
        a Collector which collects all the input elements into a ImmutableSet
      • toImmutableList

        @Deprecated
        public static <T> java.util.stream.Collector<T,​com.google.common.collect.ImmutableList.Builder<T>,​com.google.common.collect.ImmutableList<T>> toImmutableList()
        Deprecated.
        in 1.11.0 consider using ImmutableList.toImmutableList() instead.
        Returns a Collector that accumulates the input elements into a new ImmutableList.
        Type Parameters:
        T - type
        Returns:
        a Collector which collects all the input elements into a ImmutableList, in encounter order