Package | Description |
---|---|
com.annimon.stream |
Modifier and Type | Method and Description |
---|---|
static <T> Optional<T> |
Optional.empty()
Returns an empty
Optional . |
Optional<T> |
Optional.filter(Predicate<? super T> predicate)
Performs filtering on inner value if it is present.
|
Optional<T> |
Stream.findFirst()
Returns the first element wrapped by
Optional class. |
Optional<T> |
Stream.findLast()
Returns the last element wrapped by
Optional class. |
<U> Optional<U> |
Optional.flatMap(Function<? super T,Optional<U>> mapper)
Invokes mapping function with
Optional result if value is present. |
<U> Optional<U> |
Optional.map(Function<? super T,? extends U> mapper)
Invokes the given mapping function on inner value if present.
|
Optional<T> |
Stream.max(java.util.Comparator<? super T> comparator)
Finds the maximum element according to the given comparator.
|
<U extends java.lang.Comparable<? super U>> |
Stream.maxBy(Function<? super T,U> keyExtractor) |
Optional<T> |
Stream.min(java.util.Comparator<? super T> comparator)
Finds the minimum element according to the given comparator.
|
<U extends java.lang.Comparable<? super U>> |
Stream.minBy(Function<? super T,U> keyExtractor) |
static <T> Optional<T> |
Optional.of(T value)
Returns an
Optional with the specified present non-null value. |
static <T> Optional<T> |
Optional.ofNullable(T value)
Returns an
Optional with the specified value, or empty Optional if value is null. |
Optional<T> |
Stream.reduce(BiFunction<T,T,T> accumulator)
Reduces the elements using provided associative accumulation function.
|
Optional<java.util.Map.Entry<K,V>> |
EntryStream.reduce(BinaryOperator<java.util.Map.Entry<K,V>> accumulator) |
Modifier and Type | Method and Description |
---|---|
<U> Optional<U> |
Optional.flatMap(Function<? super T,Optional<U>> mapper)
Invokes mapping function with
Optional result if value is present. |