public interface Unary<T> extends Nary<T>, MonoElement<T>
Nary by putting an upper bound on the possible quantity of elements and thus
allowing to offer more operations as part of the api.Optional api including Stream operations.Optional but integrating it better with
Streams, and allows combining them without having to do intermediate conversions
(in contrast to native Stream and Optional types).
Date: 4/1/20 - 12:14Stream.Builder<T>| Modifier and Type | Method and Description |
|---|---|
Unary<T> |
distinct() |
Unary<T> |
filter(Predicate<? super T> predicate) |
Unary<T> |
limit(long maxSize) |
<R> Unary<R> |
map(Function<? super T,? extends R> mapper) |
<U> Unary<U> |
mapFilteringNullResult(Function<? super T,? extends U> mapper)
Map each element on this instance and filter null results out.
If the result of mapping an element produces null, then it's skipped, reducing the
amount of elements contained in the returned Nary.This is semantically equivalent to Optional.map(Function) and
different from Stream.map(Function) that takes null
as valid results |
Unary<T> |
peek(Consumer<? super T> action) |
Unary<T> |
skip(long n) |
Unary<T> |
sorted() |
Unary<T> |
sorted(Comparator<? super T> comparator) |
empty, equals, from, from, from, from, from, from, from, from, from, from, hashCode, of, ofNonNullable, ofNonNullable, toStringadd, collect, collectToList, collectToSet, concat, concat, findAnyNary, findFirstNary, findLast, flatMapOptional, forEach, maxNary, minNary, reduceNary, spliterator, uniqueflatMapallMatch, anyMatch, builder, collect, collect, concat, count, findAny, findFirst, flatMapToDouble, flatMapToInt, flatMapToLong, forEachOrdered, generate, iterate, mapToDouble, mapToInt, mapToLong, max, min, noneMatch, reduce, reduce, reduce, toArray, toArrayclose, isParallel, iterator, onClose, parallel, sequential, unorderedasOptional, get, ifAbsent, ifPresent, isAbsent, isPresent, orElse, orElseGet, orElseThrow, orElseUseUnary<T> sorted(Comparator<? super T> comparator)
<U> Unary<U> mapFilteringNullResult(Function<? super T,? extends U> mapper)
MultiElementnull, then it's skipped, reducing the
amount of elements contained in the returned Nary.Optional.map(Function) and
different from Stream.map(Function) that takes null
as valid resultsmapFilteringNullResult in interface MultiElement<T>U - The type of the result of the mapping functionmapper - a mapping function to apply to the value, if presentCopyright © 2020. All rights reserved.