| Package | Description |
|---|---|
| com.annimon.stream | |
| com.annimon.stream.function | |
| com.annimon.stream.operator |
| 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> IndexedConsumer<T> |
IndexedConsumer.Util.accept(IntConsumer c1,
Consumer<? super T> c2)
Returns an
IndexedConsumer that accepts IntConsumer
for index and Consumer for object. |
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. |
static <T> IndexedConsumer<T> |
IndexedConsumer.Util.wrap(Consumer<? super T> consumer)
Wraps a
Consumer and returns IndexedConsumer. |
| Constructor and Description |
|---|
ObjPeek(Iterator<? extends T> iterator,
Consumer<? super T> action) |
Copyright © 2018. All rights reserved.