Package com.uber.okbuck.core.util
Class MoreCollectors
- java.lang.Object
-
- com.uber.okbuck.core.util.MoreCollectors
-
public final class MoreCollectors extends java.lang.Object
-
-
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<T>>toImmutableList()Returns aCollectorthat builds anImmutableList.static <T> java.util.stream.Collector<T,?,com.google.common.collect.ImmutableSet<T>>toImmutableSet()Returns aCollectorthat builds anImmutableSet.
-
-
-
Method Detail
-
toImmutableList
public static <T> java.util.stream.Collector<T,?,com.google.common.collect.ImmutableList<T>> toImmutableList()
Returns aCollectorthat builds anImmutableList.This
Collectorbehaves similar toCollectors.collectingAndThen(Collectors.toList(), ImmutableList::copyOf)but without building the intermediate list.- Type Parameters:
T- the type of the input elements- Returns:
- a
Collectorthat builds anImmutableList.
-
toImmutableSet
public static <T> java.util.stream.Collector<T,?,com.google.common.collect.ImmutableSet<T>> toImmutableSet()
Returns aCollectorthat builds anImmutableSet.This
Collectorbehaves similar toCollectors.collectingAndThen(Collectors.toList(), ImmutableSet::copyOf)but without building the intermediate list.- Type Parameters:
T- the type of the input elements- Returns:
- a
Collectorthat builds anImmutableSet.
-
-