Class MoreStreams


  • public final class MoreStreams
    extends java.lang.Object
    A utility class that provides Android compatible alternatives to Guava's streaming APIs.

    This is useful when the Android flavor of Guava somehow finds its way onto the processor classpath.

    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static <T,​K,​V>
      java.util.stream.Collector<T,​?,​com.google.common.collect.ImmutableBiMap<K,​V>>
      toImmutableBiMap​(java.util.function.Function<? super T,​K> keyMapper, java.util.function.Function<? super T,​V> valueMapper)
      Returns a collector for an ImmutableBiMap.
      static <T> java.util.stream.Collector<T,​?,​com.google.common.collect.ImmutableList<T>> toImmutableList()
      Returns a collector for an ImmutableList.
      static <T,​K,​V>
      java.util.stream.Collector<T,​?,​com.google.common.collect.ImmutableMap<K,​V>>
      toImmutableMap​(java.util.function.Function<? super T,​K> keyMapper, java.util.function.Function<? super T,​V> valueMapper)
      Returns a collector for an ImmutableMap.
      static <T> java.util.stream.Collector<T,​?,​com.google.common.collect.ImmutableSet<T>> toImmutableSet()
      Returns a collector for an ImmutableSet.
      • Methods inherited from class java.lang.Object

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

      • toImmutableList

        public static <T> java.util.stream.Collector<T,​?,​com.google.common.collect.ImmutableList<T>> toImmutableList()
        Returns a collector for an ImmutableList.
      • toImmutableSet

        public static <T> java.util.stream.Collector<T,​?,​com.google.common.collect.ImmutableSet<T>> toImmutableSet()
        Returns a collector for an ImmutableSet.
      • toImmutableMap

        public static <T,​K,​V> java.util.stream.Collector<T,​?,​com.google.common.collect.ImmutableMap<K,​V>> toImmutableMap​(java.util.function.Function<? super T,​K> keyMapper,
                                                                                                                                                       java.util.function.Function<? super T,​V> valueMapper)
        Returns a collector for an ImmutableMap.
      • toImmutableBiMap

        public static <T,​K,​V> java.util.stream.Collector<T,​?,​com.google.common.collect.ImmutableBiMap<K,​V>> toImmutableBiMap​(java.util.function.Function<? super T,​K> keyMapper,
                                                                                                                                                           java.util.function.Function<? super T,​V> valueMapper)
        Returns a collector for an ImmutableBiMap.