public final class Collect extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
Collect.CollectorImpl<T,A,R>
Simple implementation class for
Collector. |
| Modifier and Type | Field and Description |
|---|---|
static Set<java.util.stream.Collector.Characteristics> |
CH_ID |
| Constructor and Description |
|---|
Collect() |
| Modifier and Type | Method and Description |
|---|---|
static <I,R> java.util.function.Function<I,R> |
castingIdentity() |
static <T,A> java.util.stream.Collector<T,List<A>,List<A>> |
collectList(java.util.function.BiConsumer<List<A>,T> consumer)
Returns a
Collector that accumulates the input list elements into a
new List. |
static <T,C extends Collection<T>> |
combineCollection(java.util.function.Supplier<C> collectionFactory)
Returns a
Collector that accumulates the input elements into a new
Collection, in encounter order. |
static <T> java.util.stream.Collector<List<T>,?,List<T>> |
combineList()
Returns a
Collector that accumulates the input list elements into a
new List. |
static <T> java.util.function.Function<T,T> |
passthrough() |
public static final Set<java.util.stream.Collector.Characteristics> CH_ID
public static <I,R> java.util.function.Function<I,R> castingIdentity()
public static <T> java.util.function.Function<T,T> passthrough()
public static <T,C extends Collection<T>> java.util.stream.Collector<C,?,C> combineCollection(java.util.function.Supplier<C> collectionFactory)
Collector that accumulates the input elements into a new
Collection, in encounter order. The Collection is created by
the provided factory.T - the collection type of the input elementsC - the type of the resulting CollectioncollectionFactory - a Supplier which returns a new, empty
Collection of the appropriate typeCollector which collects all the input elements into a
Collection, in encounter orderpublic static <T> java.util.stream.Collector<List<T>,?,List<T>> combineList()
Collector that accumulates the input list elements into a
new List. There are no guarantees on the type, mutability,
serializability, or thread-safety of the List returned; if more
control over the returned List is required, useT - the collection type of the input elementsCollector which collects all the input elements into a
List, in encounter orderpublic static <T,A> java.util.stream.Collector<T,List<A>,List<A>> collectList(java.util.function.BiConsumer<List<A>,T> consumer)
Collector that accumulates the input list elements into a
new List. There are no guarantees on the type, mutability,
serializability, or thread-safety of the List returned; if more
control over the returned List is required, useT - the type of the input elementsA - the type of the output elementconsumer - accumulator of collectorCollector which collects all the transformed elements into
a List, in encounter orderCopyright © 2021. All rights reserved.