public class MoreCollectors
extends java.lang.Object
Collector.Collectors| Modifier and Type | Method | Description |
|---|---|---|
static <E> java.util.stream.Collector<E,java.util.List<E>,java.util.List<E>> |
toUnmodifiableList() |
Returns a
Collector that accumulates the input elements into a new unmodifiable List. |
static <E,C extends java.util.List<E>> |
toUnmodifiableList(java.util.function.Supplier<C> listFactory) |
Returns a
Collector that accumulates the input elements into a new unmodifiable List. |
static <E> java.util.stream.Collector<E,java.util.Set<E>,java.util.Set<E>> |
toUnmodifiableSet() |
Returns a
Collector that accumulates the input elements into a new unmodifiable Set. |
static <E,C extends java.util.Set<E>> |
toUnmodifiableSet(java.util.function.Supplier<C> setFactory) |
Returns a
Collector that accumulates the input elements into a new unmodifiable Set. |
public static <E> java.util.stream.Collector<E,java.util.List<E>,java.util.List<E>> toUnmodifiableList()
Collector that accumulates the input elements into a new unmodifiable List.public static <E,C extends java.util.List<E>> java.util.stream.Collector<E,C,java.util.List<E>> toUnmodifiableList(java.util.function.Supplier<C> listFactory)
Collector that accumulates the input elements into a new unmodifiable List.
Uses the given factory to create the internal list.public static <E> java.util.stream.Collector<E,java.util.Set<E>,java.util.Set<E>> toUnmodifiableSet()
Collector that accumulates the input elements into a new unmodifiable Set.public static <E,C extends java.util.Set<E>> java.util.stream.Collector<E,C,java.util.Set<E>> toUnmodifiableSet(java.util.function.Supplier<C> setFactory)
Collector that accumulates the input elements into a new unmodifiable Set.
Uses the given factory to create the internal set.