T
- Consumed type 1.E
- Thrown exception.@FunctionalInterface
public interface FailableConsumer<T,E extends java.lang.Throwable>
Consumer
that declares a Throwable
.Modifier and Type | Field and Description |
---|---|
static FailableConsumer |
NOP
NOP singleton
|
Modifier and Type | Method and Description |
---|---|
void |
accept(T object)
Accepts the consumer.
|
default FailableConsumer<T,E> |
andThen(FailableConsumer<? super T,E> after)
Returns a composed
Consumer like Consumer.andThen(Consumer) . |
static <T,E extends java.lang.Throwable> |
nop()
Returns The NOP singleton.
|
static final FailableConsumer NOP
static <T,E extends java.lang.Throwable> FailableConsumer<T,E> nop()
T
- Consumed type 1.E
- Thrown exception.void accept(T object) throws E extends java.lang.Throwable
object
- the parameter for the consumable to acceptE
- Thrown when the consumer fails.E extends java.lang.Throwable
default FailableConsumer<T,E> andThen(FailableConsumer<? super T,E> after)
Consumer
like Consumer.andThen(Consumer)
.after
- the operation to perform after this operationConsumer
like Consumer.andThen(Consumer)
.java.lang.NullPointerException
- when after
is null