Class FinallyRunAll

java.lang.Object
org.aksw.commons.util.exception.FinallyRunAll
All Implemented Interfaces:
Runnable

@Deprecated public class FinallyRunAll extends Object implements 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>
  • Field Details

  • Constructor Details

    • FinallyRunAll

      public FinallyRunAll()
      Deprecated.
    • FinallyRunAll

      public FinallyRunAll(List<ThrowingRunnable> actions)
      Deprecated.
  • Method Details