Package org.apache.flink.util.function
Interface ThrowingConsumer<T,E extends Throwable>
-
- Type Parameters:
T- type of the consumed elements.E- type of the exception thrown.
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
@Public @FunctionalInterface public interface ThrowingConsumer<T,E extends Throwable>
This interface is basically Java'sConsumerinterface enhanced with the ability to throw an exception.
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description voidaccept(T t)Performs this operation on the given argument.static <A> java.util.function.Consumer<A>unchecked(ThrowingConsumer<A,?> throwingConsumer)Convert aThrowingConsumerinto aConsumer.
-
-
-
Method Detail
-
unchecked
static <A> java.util.function.Consumer<A> unchecked(ThrowingConsumer<A,?> throwingConsumer)
Convert aThrowingConsumerinto aConsumer.- Type Parameters:
A- input type- Parameters:
throwingConsumer- Consumer with exception to convert into aConsumer.- Returns:
Consumerwhich rethrows all checked exceptions as unchecked.
-
-