- java.lang.Object
-
- com.aoapps.lang.Runnables
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static ThrowablerunAndCatch(Iterable<? extends Runnable> runnable)static ThrowablerunAndCatch(Runnable runnable)static ThrowablerunAndCatch(Runnable... runnable)static ThrowablerunAndCatch(Throwable t0, Iterable<? extends Runnable> runnable)static ThrowablerunAndCatch(Throwable t0, Runnable runnable)static ThrowablerunAndCatch(Throwable t0, Runnable... runnable)
-
-
-
Method Detail
-
runAndCatch
public static Throwable runAndCatch(Throwable t0, Runnable runnable)
Runs the givenRunnable, catching allThrowable.See
Throwables.addSuppressed(java.lang.Throwable, java.lang.Throwable)for details on howThreadDeathandInterruptedExceptionare managed.- Parameters:
t0- If notnull, any new throwables will be combined viaThrowables.addSuppressed(java.lang.Throwable, java.lang.Throwable)runnable- The runnable to be invoked- Returns:
t0, a new throwable, ornullwhen none given and none new
-
runAndCatch
public static Throwable runAndCatch(Runnable runnable)
Runs the givenRunnable, catching allThrowable.See
Throwables.addSuppressed(java.lang.Throwable, java.lang.Throwable)for details on howThreadDeathandInterruptedExceptionare managed.- Parameters:
runnable- The runnable to be invoked- Returns:
- A new throwable or
null
-
runAndCatch
public static Throwable runAndCatch(Throwable t0, Runnable... runnable)
Runs all of the givenRunnablein order, catching allThrowable.See
Throwables.addSuppressed(java.lang.Throwable, java.lang.Throwable)for details on howThreadDeathandInterruptedExceptionare managed.- Parameters:
t0- If notnull, any new throwables will be combined viaThrowables.addSuppressed(java.lang.Throwable, java.lang.Throwable)runnable- The set of all runnables, which will be invoked in order- Returns:
t0, a new throwable, ornullwhen none given and none new
-
runAndCatch
public static Throwable runAndCatch(Runnable... runnable)
Runs all of the givenRunnablein order, catching allThrowable.See
Throwables.addSuppressed(java.lang.Throwable, java.lang.Throwable)for details on howThreadDeathandInterruptedExceptionare managed.- Parameters:
runnable- The set of all runnables, which will be invoked in order- Returns:
- A new throwable or
null
-
runAndCatch
public static Throwable runAndCatch(Throwable t0, Iterable<? extends Runnable> runnable)
Runs all of the givenRunnablein order, catching allThrowable.See
Throwables.addSuppressed(java.lang.Throwable, java.lang.Throwable)for details on howThreadDeathandInterruptedExceptionare managed.- Parameters:
t0- If notnull, any new throwables will be combined viaThrowables.addSuppressed(java.lang.Throwable, java.lang.Throwable)runnable- The set of all runnables, which will be invoked in order- Returns:
t0, a new throwable, ornullwhen none given and none new
-
runAndCatch
public static Throwable runAndCatch(Iterable<? extends Runnable> runnable)
Runs all of the givenRunnablein order, catching allThrowable.See
Throwables.addSuppressed(java.lang.Throwable, java.lang.Throwable)for details on howThreadDeathandInterruptedExceptionare managed.- Parameters:
runnable- The set of all runnables, which will be invoked in order- Returns:
- A new throwable or
null
-
-