public interface StreamUtils
Stream
utility methods and classes.Modifier and Type | Method and Description |
---|---|
static <T> Stream<T> |
createStreamFromIterator(Iterator<T> iterator)
|
static <T,K,V> Collector<T,MultiValueMap<K,V>,MultiValueMap<K,V>> |
toMultiMap(Function<T,K> keyFunction,
Function<T,V> valueFunction)
Returns a
Collector to create a MultiValueMap . |
static <T> Collector<T,?,List<T>> |
toUnmodifiableList()
|
static <T> Collector<T,?,Set<T>> |
toUnmodifiableSet()
|
static <T> Stream<T> createStreamFromIterator(Iterator<T> iterator)
Stream
backed by the given Iterator
.
If the given iterator is an CloseableIterator
add a CloseableIteratorDisposingRunnable
wrapping the
given iterator to propagate BaseStream.close()
accordingly.
iterator
- must not be nullstatic <T> Collector<T,?,List<T>> toUnmodifiableList()
static <T,K,V> Collector<T,MultiValueMap<K,V>,MultiValueMap<K,V>> toMultiMap(Function<T,K> keyFunction, Function<T,V> valueFunction)
Collector
to create a MultiValueMap
.Copyright © 2011–2017 Pivotal Software, Inc.. All rights reserved.