| Modifier and Type | Method and Description |
|---|---|
static <T> Consumer<T> |
andThen(Consumer<? super T> c1,
Consumer<? super T> c2)
Composes
Consumer calls. |
static <T> Consumer<T> |
safe(ThrowableConsumer<? super T,Throwable> throwableConsumer)
Creates a safe
Consumer. |
static <T> Consumer<T> |
safe(ThrowableConsumer<? super T,Throwable> throwableConsumer,
Consumer<? super T> onFailedConsumer)
Creates a safe
Consumer. |
public static <T> Consumer<T> andThen(Consumer<? super T> c1, Consumer<? super T> c2)
Consumer calls.
c1.accept(value); c2.accept(value);
T - the type of the input to the operationc1 - the first Consumerc2 - the second ConsumerConsumerNullPointerException - if c1 or c2 is nullpublic static <T> Consumer<T> safe(ThrowableConsumer<? super T,Throwable> throwableConsumer)
Consumer.T - the type of the input to the functionthrowableConsumer - the consumer that may throw an exceptionConsumerNullPointerException - if throwableConsumer is nullsafe(com.annimon.stream.function.ThrowableConsumer, com.annimon.stream.function.Consumer)public static <T> Consumer<T> safe(ThrowableConsumer<? super T,Throwable> throwableConsumer, Consumer<? super T> onFailedConsumer)
Consumer.T - the type of the input to the functionthrowableConsumer - the consumer that may throw an exceptiononFailedConsumer - the consumer which applies if exception was thrownConsumerNullPointerException - if throwableConsumer is nullsafe(com.annimon.stream.function.ThrowableConsumer)Copyright © 2018. All rights reserved.