public final class CollectionUtils extends Object
Modifier and Type | Method and Description |
---|---|
static <T> List<T> |
concatList(List<T> head,
T... tail)
Returns a new list contains the head elements followed by the tail elements.
|
static <T> Stream<T> |
concatStream(List<Stream<T>> streams)
Returns a stream that concatenates the members of the given streams.
|
static <T> Stream<T> |
concatStream(Stream<T>... streams)
Returns a stream that concatenates the members of the given streams.
|
static <K,V> Map.Entry<K,V> |
mapping(K key,
V value)
Returns a mapping of the given value to the given key.
|
static <T,K,V> Collector<T,?,Map<K,V>> |
toOrderedMap(Function<T,K> keyMapper,
Function<T,V> valueMapper)
A collector that produces a map sorted in insertion order.
|
static <T> Stream<T> |
toStream(Iterable<T> iterable)
Returns a stream that produces the sequence defined by the given Iterable.
|
static <T> Stream<T> |
toStream(Iterator<T> iterator)
Returns a stream that produces the sequence defined by the given Iterator.
|
public static <T> Stream<T> toStream(Iterator<T> iterator)
public static <T> Stream<T> toStream(Iterable<T> iterable)
public static <T,K,V> Collector<T,?,Map<K,V>> toOrderedMap(Function<T,K> keyMapper, Function<T,V> valueMapper)
public static <K,V> Map.Entry<K,V> mapping(K key, V value)
@SafeVarargs public static <T> List<T> concatList(List<T> head, T... tail)
@SafeVarargs public static <T> Stream<T> concatStream(Stream<T>... streams)
Copyright © 2024 The Cornutum Project. All rights reserved.