Class ImmutableCollectors


  • public class ImmutableCollectors
    extends java.lang.Object
    Util for creating Collector that creates immutable collections, similar to Collectors.
    • Method Summary

      All Methods Static Methods Concrete 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()  
      static <T> java.util.stream.Collector<T,​com.google.common.collect.ImmutableSet.Builder<T>,​com.google.common.collect.ImmutableSet<T>> toImmutableSet()  
      • Methods inherited from class java.lang.Object

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

      • ImmutableCollectors

        public ImmutableCollectors()
    • Method Detail

      • toImmutableList

        public static <T> java.util.stream.Collector<T,​com.google.common.collect.ImmutableList.Builder<T>,​com.google.common.collect.ImmutableList<T>> toImmutableList()
      • toImmutableSet

        public static <T> java.util.stream.Collector<T,​com.google.common.collect.ImmutableSet.Builder<T>,​com.google.common.collect.ImmutableSet<T>> toImmutableSet()