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(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 Consumer
c2
- the second Consumer
Consumer
java.lang.NullPointerException
- if c1
or c2
is nullpublic static <T> Consumer<T> safe(ThrowableConsumer<? super T,java.lang.Throwable> throwableConsumer)
Consumer
.T
- the type of the input to the functionthrowableConsumer
- the consumer that may throw an exceptionConsumer
java.lang.NullPointerException
- if throwableConsumer
is nullsafe(com.annimon.stream.function.ThrowableConsumer, com.annimon.stream.function.Consumer)
public static <T> Consumer<T> safe(ThrowableConsumer<? super T,java.lang.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 thrownConsumer
java.lang.NullPointerException
- if throwableConsumer
is nullsafe(com.annimon.stream.function.ThrowableConsumer)