Package com.storedobject.common
Interface EConsumer<T,E extends Exception>
- Type Parameters:
T- the type of the input argument to the operationE- the type of exception that the operation might throw
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
A functional interface that represents an operation on a single input
that might throw a checked exception of a specific type.
This interface is designed for use with lambda expressions or method
references when a checked exception needs to be handled.
- Author:
- Syam
-
Method Summary
Modifier and TypeMethodDescriptionvoidPerforms an operation on the given input argument, potentially throwing a checked exception of a specific type.Wraps anEConsumerinto a standardConsumer, converting any checked exceptions thrown by the suppliedEConsumerinto an uncheckedSORuntimeException.
-
Method Details
-
accept
Performs an operation on the given input argument, potentially throwing a checked exception of a specific type.- Parameters:
t- the input argument to the operation- Throws:
E- if the operation encounters an exception
-
wrap
Wraps anEConsumerinto a standardConsumer, converting any checked exceptions thrown by the suppliedEConsumerinto an uncheckedSORuntimeException.
-