Class CheckRunnable

java.lang.Object
io.hotmoka.exceptions.CheckRunnable

public abstract class CheckRunnable extends Object
Methods that check an unchecked exception thrown by a runnable.
  • Method Details

    • check

      public static <T extends Throwable> void check(Class<? extends T> exception, Runnable runnable) throws T
      Runs a runnable and makes an unchecked exception type into checked.
      Type Parameters:
      T - the type of the exception
      Parameters:
      exception - the class of the exception
      runnable - the runnable
      Throws:
      T - if the runnable throws an unchecked exception with this cause
    • check

      public static <T1 extends Throwable, T2 extends Throwable> void check(Class<? extends T1> exception1, Class<? extends T2> exception2, Runnable runnable) throws T1, T2
      Runs a runnable and makes two unchecked exception types into checked.
      Type Parameters:
      T1 - the first type of the exception
      T2 - the second type of the exception
      Parameters:
      exception1 - the class of the first exception
      exception2 - the class of the second exception
      runnable - the runnable
      Throws:
      T1 - if the runnable throws an unchecked exception with this cause
      T2 - if the runnable throws an unchecked exception with this cause
    • check

      public static <T1 extends Throwable, T2 extends Throwable, T3 extends Throwable> void check(Class<? extends T1> exception1, Class<? extends T2> exception2, Class<? extends T3> exception3, Runnable runnable) throws T1, T2, T3
      Runs a runnable and makes three unchecked exception types into checked.
      Type Parameters:
      T1 - the first type of the exception
      T2 - the second type of the exception
      T3 - the third type of the exception
      Parameters:
      exception1 - the class of the first exception
      exception2 - the class of the second exception
      exception3 - the class of the third exception
      runnable - the runnable
      Throws:
      T1 - if the runnable throws an unchecked exception with this cause
      T2 - if the runnable throws an unchecked exception with this cause
      T3 - if the runnable throws an unchecked exception with this cause
    • check

      public static <T1 extends Throwable, T2 extends Throwable, T3 extends Throwable, T4 extends Throwable> void check(Class<? extends T1> exception1, Class<? extends T2> exception2, Class<? extends T3> exception3, Class<? extends T4> exception4, Runnable runnable) throws T1, T2, T3, T4
      Runs a runnable and makes four unchecked exception types into checked.
      Type Parameters:
      T1 - the first type of the exception
      T2 - the second type of the exception
      T3 - the third type of the exception
      T4 - the fourth type of the exception
      Parameters:
      exception1 - the class of the first exception
      exception2 - the class of the second exception
      exception3 - the class of the third exception
      exception4 - the class of the fourth exception
      runnable - the runnable
      Throws:
      T1 - if the runnable throws an unchecked exception with this cause
      T2 - if the runnable throws an unchecked exception with this cause
      T3 - if the runnable throws an unchecked exception with this cause
      T4 - if the runnable throws an unchecked exception with this cause
    • check

      public static <T1 extends Throwable, T2 extends Throwable, T3 extends Throwable, T4 extends Throwable, T5 extends Throwable> void check(Class<? extends T1> exception1, Class<? extends T2> exception2, Class<? extends T3> exception3, Class<? extends T4> exception4, Class<? extends T5> exception5, Runnable runnable) throws T1, T2, T3, T4, T5
      Runs a runnable and makes five unchecked exception types into checked.
      Type Parameters:
      T1 - the first type of the exception
      T2 - the second type of the exception
      T3 - the third type of the exception
      T4 - the fourth type of the exception
      T5 - the fifth type of the exception
      Parameters:
      exception1 - the class of the first exception
      exception2 - the class of the second exception
      exception3 - the class of the third exception
      exception4 - the class of the fourth exception
      exception5 - the class of the fifth exception
      runnable - the runnable
      Throws:
      T1 - if the runnable throws an unchecked exception with this cause
      T2 - if the runnable throws an unchecked exception with this cause
      T3 - if the runnable throws an unchecked exception with this cause
      T4 - if the runnable throws an unchecked exception with this cause
      T5 - if the runnable throws an unchecked exception with this cause
    • check

      public static <T1 extends Throwable, T2 extends Throwable, T3 extends Throwable, T4 extends Throwable, T5 extends Throwable, T6 extends Throwable> void check(Class<? extends T1> exception1, Class<? extends T2> exception2, Class<? extends T3> exception3, Class<? extends T4> exception4, Class<? extends T5> exception5, Class<? extends T6> exception6, Runnable runnable) throws T1, T2, T3, T4, T5, T6
      Runs a runnable and makes six unchecked exception types into checked.
      Type Parameters:
      T1 - the first type of the exception
      T2 - the second type of the exception
      T3 - the third type of the exception
      T4 - the fourth type of the exception
      T5 - the fifth type of the exception
      T6 - the sixth type of the exception
      Parameters:
      exception1 - the class of the first exception
      exception2 - the class of the second exception
      exception3 - the class of the third exception
      exception4 - the class of the fourth exception
      exception5 - the class of the fifth exception
      exception6 - the class of the sixth exception
      runnable - the runnable
      Throws:
      T1 - if the runnable throws an unchecked exception with this cause
      T2 - if the runnable throws an unchecked exception with this cause
      T3 - if the runnable throws an unchecked exception with this cause
      T4 - if the runnable throws an unchecked exception with this cause
      T5 - if the runnable throws an unchecked exception with this cause
      T6 - if the runnable throws an unchecked exception with this cause
    • check

      public static <T1 extends Throwable, T2 extends Throwable, T3 extends Throwable, T4 extends Throwable, T5 extends Throwable, T6 extends Throwable, T7 extends Throwable> void check(Class<? extends T1> exception1, Class<? extends T2> exception2, Class<? extends T3> exception3, Class<? extends T4> exception4, Class<? extends T5> exception5, Class<? extends T6> exception6, Class<? extends T7> exception7, Runnable runnable) throws T1, T2, T3, T4, T5, T6, T7
      Runs a runnable and makes seven unchecked exception types into checked.
      Type Parameters:
      T1 - the first type of the exception
      T2 - the second type of the exception
      T3 - the third type of the exception
      T4 - the fourth type of the exception
      T5 - the fifth type of the exception
      T6 - the sixth type of the exception
      T7 - the seventh type of the exception
      Parameters:
      exception1 - the class of the first exception
      exception2 - the class of the second exception
      exception3 - the class of the third exception
      exception4 - the class of the fourth exception
      exception5 - the class of the fifth exception
      exception6 - the class of the sixth exception
      exception7 - the class of the seventh exception
      runnable - the runnable
      Throws:
      T1 - if the runnable throws an unchecked exception with this cause
      T2 - if the runnable throws an unchecked exception with this cause
      T3 - if the runnable throws an unchecked exception with this cause
      T4 - if the runnable throws an unchecked exception with this cause
      T5 - if the runnable throws an unchecked exception with this cause
      T6 - if the runnable throws an unchecked exception with this cause
      T7 - if the runnable throws an unchecked exception with this cause