public static class RunESCommand.WithException extends Object
Callable to be executed may throw an exception.| Constructor and Description |
|---|
WithException() |
| Modifier and Type | Method and Description |
|---|---|
static <T extends Exception> |
run(Class<T> exceptionType,
Callable<Void> callable)
Executes the given
Callable and returns the result. |
static <T,E extends Exception> |
runWithResult(Class<E> exceptionType,
Callable<T> callable)
Executes the given @link Callable} and returns the result.
|
public static <T,E extends Exception> T runWithResult(Class<E> exceptionType, Callable<T> callable) throws E extends Exception
E - Exception in case an error occurs during execution of the CallableT - the return type of the Callablecallable - the callable to be execuedexceptionType - the type of the exception that might be thrown during executionE - on execution failureE extends Exceptionpublic static <T extends Exception> void run(Class<T> exceptionType, Callable<Void> callable) throws T extends Exception
Callable and returns the result.T - the exception typecallable - the callable to be executedexceptionType - the type of the exceptionT - in case an error occurs during execution of the callableT extends ExceptionCopyright © 2017. All rights reserved.