Package org.aksw.commons.util.exception
Class FinallyRunAll
java.lang.Object
org.aksw.commons.util.exception.FinallyRunAll
- All Implemented Interfaces:
Runnable
Deprecated.
Force all actions in a list to run.
Usage:
FinallyAll.run(
() -> action1(),
() -> action2(),
() -> actionN()
);
This is more succinct than nested finally blocks such as:
{@code
try { action1(); } catch (Exception e) { throw new RuntimeException(e); } finally {
try { action2(); } catch ... {
try { actionN(); } catch ... {
}
}
}
</pre>-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidDeprecated.voidDeprecated.voidaddThrowing(ThrowingRunnable action) Deprecated.static FinallyRunAllcreate()Deprecated.voidrun()Deprecated.static voidrun(ThrowingRunnable... actions) Deprecated.protected voidrunAction(int index) Deprecated.static <T> voidrunAll(Collection<T> actions, FinallyRunAll.ThrowingConsumer<T> runner, ThrowingRunnable finallyAction) Deprecated.
-
Field Details
-
actions
Deprecated.
-
-
Constructor Details
-
FinallyRunAll
public FinallyRunAll()Deprecated. -
FinallyRunAll
Deprecated.
-
-
Method Details
-
create
Deprecated. -
addThrowing
Deprecated. -
add
Deprecated. -
add
Deprecated. -
run
public void run()Deprecated. -
runAction
protected void runAction(int index) Deprecated. -
run
Deprecated. -
runAll
public static <T> void runAll(Collection<T> actions, FinallyRunAll.ThrowingConsumer<T> runner, ThrowingRunnable finallyAction) Deprecated.
-