Interface ThrowingConsumer<A,T extends Throwable>
- Type Parameters:
A
- The input argument type to be consumedT
- The type ofThrowable
thrown by the consumer
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
A better version of Java's
Consumer
interface that
allows for the consumers to throw whatever Throwable
is specified.- Version:
- 0.1-Alpha-SNAPSHOT
- Author:
- Logan Ferree (Tadukoo)
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Takes a single argument and consumes it.default ThrowingConsumer<A,
T> andThen
(ThrowingConsumer<? super A, ? extends T> after) Creates a ThrowingConsumer that runs this ThrowingConsumer and then also runs the given ThrowingConsumer on the same argument.
-
Method Details
-
accept
Takes a single argument and consumes it.- Parameters:
a
- The argument- Throws:
T
- Determined by the consumer, not required
-
andThen
Creates a ThrowingConsumer that runs this ThrowingConsumer and then also runs the given ThrowingConsumer on the same argument.- Parameters:
after
- A 2nd ThrowingConsumer to run the argument on after this one- Returns:
- The ThrowingConsumer made from composing this one and the given one
-