public interface Flow<T> extends Stream<T>
Stream decorator with extra operations for convenience.Stream.Builder<T>| Modifier and Type | Method and Description |
|---|---|
static FlowImpl<Character> |
chars(char startInclusive,
char endInclusive) |
static FlowImpl<Long> |
count(long startInclusive,
long endInclusive) |
Optional<T> |
findLast()
Returns an
Optional describing the last element of this stream, or an empty Optional if the
stream is empty. |
<K,V> Map<K,List<T>> |
groupBy(Function<T,K> transformation)
Equivalent to
collect(Collectors.groupingBy(transformation)). |
static <T> FlowImpl<T> |
of(Iterable<T> values) |
static <T> FlowImpl<T> |
of(Stream<T> values) |
static <T> FlowImpl<T> |
of(T... values) |
static FlowImpl<Long> |
range(long startInclusive,
long endExclusive) |
Flow<T> |
reverse()
Reverses the order of the elements in the flow.
|
Stream<T> |
stream()
Returns the wrapped stream.
|
List<T> |
toList()
Equivalent to
collect(Collectors.toList()). |
<K,V> Map<K,V> |
toMap(Function<T,K> keyTransformation,
Function<T,V> valueTransformation)
Equivalent to
collect(Collectors.toMap(keyTransformation, valueTransformation)). |
Set<T> |
toSet()
Equivalent to
collect(Collectors.toSet()). |
<R> Flow<T> |
withNonNull(Function<? super T,R> transformation)
Equivalent to
stream.filter(x -> transformation.apply(x) != null)). |
<R> Flow<T> |
withNull(Function<? super T,R> transformation)
Equivalent to
filter(x -> transformation.apply(x) == null). |
allMatch, anyMatch, builder, collect, collect, concat, count, distinct, empty, filter, findAny, findFirst, flatMap, flatMapToDouble, flatMapToInt, flatMapToLong, forEach, forEachOrdered, generate, iterate, limit, map, mapToDouble, mapToInt, mapToLong, max, min, noneMatch, peek, reduce, reduce, reduce, skip, sorted, sorted, toArray, toArrayclose, isParallel, iterator, onClose, parallel, sequential, spliterator, unordered@SafeVarargs static <T> FlowImpl<T> of(T... values)
<K,V> Map<K,V> toMap(Function<T,K> keyTransformation, Function<T,V> valueTransformation)
collect(Collectors.toMap(keyTransformation, valueTransformation)).<R> Flow<T> withNonNull(Function<? super T,R> transformation)
stream.filter(x -> transformation.apply(x) != null)).<R> Flow<T> withNull(Function<? super T,R> transformation)
filter(x -> transformation.apply(x) == null).<K,V> Map<K,List<T>> groupBy(Function<T,K> transformation)
collect(Collectors.groupingBy(transformation)).Copyright © 2014–2016 Nikolche Mihajlovski and contributors. All rights reserved.