| Package | Description |
|---|---|
| com.annimon.stream | |
| com.annimon.stream.function |
| Modifier and Type | Method and Description |
|---|---|
Optional<T> |
Optional.executeIfPresent(Consumer<? super T> consumer)
Invokes consumer function with the value if present.
|
void |
Stream.forEach(Consumer<? super T> action)
Performs the given action on each element.
|
Exceptional<T> |
Exceptional.ifException(Consumer<Throwable> consumer)
Invokes consumer function if there were any exception.
|
<E extends Throwable> |
Exceptional.ifExceptionIs(Class<E> throwableClass,
Consumer<? super E> consumer)
Invokes consumer function if exception class matches
throwableClass. |
void |
Optional.ifPresent(Consumer<? super T> consumer)
Invokes consumer function with value if present.
|
Exceptional<T> |
Exceptional.ifPresent(Consumer<? super T> consumer)
Invokes consumer function with value if present.
|
void |
Optional.ifPresentOrElse(Consumer<? super T> consumer,
Runnable emptyAction)
If a value is present, performs the given action with the value, otherwise performs the given empty-based action.
|
Stream<T> |
Stream.peek(Consumer<? super T> action)
Performs provided action on each element.
|
| Modifier and Type | Method and Description |
|---|---|
static <T> Consumer<T> |
Consumer.Util.andThen(Consumer<? super T> c1,
Consumer<? super T> c2)
Composes
Consumer calls. |
static <T> Consumer<T> |
Consumer.Util.safe(ThrowableConsumer<? super T,Throwable> throwableConsumer)
Creates a safe
Consumer. |
static <T> Consumer<T> |
Consumer.Util.safe(ThrowableConsumer<? super T,Throwable> throwableConsumer,
Consumer<? super T> onFailedConsumer)
Creates a safe
Consumer. |
| Modifier and Type | Method and Description |
|---|---|
static <T> Consumer<T> |
Consumer.Util.andThen(Consumer<? super T> c1,
Consumer<? super T> c2)
Composes
Consumer calls. |
static <T> Consumer<T> |
Consumer.Util.andThen(Consumer<? super T> c1,
Consumer<? super T> c2)
Composes
Consumer calls. |
static <T> Consumer<T> |
Consumer.Util.safe(ThrowableConsumer<? super T,Throwable> throwableConsumer,
Consumer<? super T> onFailedConsumer)
Creates a safe
Consumer. |
Copyright © 2017. All rights reserved.