| 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,java.lang.Throwable> throwableConsumer)
Creates a safe
Consumer. |
static <T> Consumer<T> |
safe(ThrowableConsumer<? super T,java.lang.Throwable> throwableConsumer,
Consumer<? super T> onFailedConsumer)
Creates a safe
Consumer. |
public static <T> Consumer<T> andThen(@NotNull Consumer<? super T> c1, @NotNull 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 ConsumerConsumerjava.lang.NullPointerException - if c1 or c2 is nullpublic static <T> Consumer<T> safe(@NotNull ThrowableConsumer<? super T,java.lang.Throwable> throwableConsumer)
Consumer.T - the type of the input to the functionthrowableConsumer - the consumer that may throw an exceptionConsumerjava.lang.NullPointerException - if throwableConsumer is nullsafe(com.annimon.stream.function.ThrowableConsumer, com.annimon.stream.function.Consumer)public static <T> Consumer<T> safe(@NotNull ThrowableConsumer<? super T,java.lang.Throwable> throwableConsumer, @Nullable 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 thrownConsumerjava.lang.NullPointerException - if throwableConsumer is nullsafe(com.annimon.stream.function.ThrowableConsumer)