Module io.xlate.staedi
Package io.xlate.edi.internal
Interface ThrowingRunnable<T extends Exception>
- Type Parameters:
T- the type of exception that may be thrown
public interface ThrowingRunnable<T extends Exception>
A
Runnable that can throw exceptions/errors. Internal use only.- Since:
- 1.24
-
Method Summary
Modifier and TypeMethodDescriptionvoidrun()Run any code provided by an implementation, including code that may throw an exception.run(ThrowingRunnable<T> task, Function<T, E> exceptionWrapper) Execute the provided task and apply the given exceptionWrapper function on any exception thrown by it.
-
Method Details
-
run
Run any code provided by an implementation, including code that may throw an exception.- Throws:
T- any exception thrown by the implementation of this method
-
run
static <T extends Exception,E extends Exception> void run(ThrowingRunnable<T> task, Function<T, E> exceptionWrapper) throws EExecute the provided task and apply the given exceptionWrapper function on any exception thrown by it.- Type Parameters:
T- the type of exception that may be thrownE- the type of exception that this method may throw, wrapping any thrown by task- Parameters:
task- runnable to execute that may thrown an exception TexceptionWrapper- wrapper function to wrap/convert an exception T to an exception E- Throws:
E- exception thrown when task throws an exception T
-