Class CheckSupplier

java.lang.Object
io.hotmoka.exceptions.CheckSupplier

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

    • check

      public static <R, T extends Throwable> R check(Class<? extends T> exception, Supplier<? extends R> supplier) throws T
      Runs a supplier and makes an unchecked exception into checked.
      Type Parameters:
      R - the type of the return type of the supplied value
      T - the type of the exception
      Parameters:
      exception - the class of the exception
      supplier - the supplier
      Returns:
      the supplied value
      Throws:
      T - if the supplier throws an unchecked exception with this cause
    • check

      public static <R, T1 extends Throwable, T2 extends Throwable> R check(Class<? extends T1> exception1, Class<? extends T2> exception2, Supplier<? extends R> supplier) throws T1, T2
      Runs a supplier and makes two unchecked exceptions into checked.
      Type Parameters:
      R - the type of the return type of the supplied value
      T1 - the type of the first exception
      T2 - the type of the second exception
      Parameters:
      exception1 - the class of the first exception
      exception2 - the class of the second exception
      supplier - the supplier
      Returns:
      the supplied value
      Throws:
      T1 - if the supplier throws an unchecked exception with this cause
      T2 - if the supplier throws an unchecked exception with this cause
    • check

      public static <R, T1 extends Throwable, T2 extends Throwable, T3 extends Throwable> R check(Class<? extends T1> exception1, Class<? extends T2> exception2, Class<? extends T3> exception3, Supplier<? extends R> supplier) throws T1, T2, T3
      Runs a supplier and makes three unchecked exceptions into checked.
      Type Parameters:
      R - the type of the return type of the supplied value
      T1 - the type of the first exception
      T2 - the type of the second exception
      T3 - the type of the third exception
      Parameters:
      exception1 - the class of the first exception
      exception2 - the class of the second exception
      exception3 - the class of the third exception
      supplier - the supplier
      Returns:
      the supplied value
      Throws:
      T1 - if the supplier throws an unchecked exception with this cause
      T2 - if the supplier throws an unchecked exception with this cause
      T3 - if the supplier throws an unchecked exception with this cause
    • check

      public static <R, T1 extends Throwable, T2 extends Throwable, T3 extends Throwable, T4 extends Throwable> R check(Class<? extends T1> exception1, Class<? extends T2> exception2, Class<? extends T3> exception3, Class<? extends T4> exception4, Supplier<? extends R> supplier) throws T1, T2, T3, T4
      Runs a supplier and makes four unchecked exceptions into checked.
      Type Parameters:
      R - the type of the return type of the supplied value
      T1 - the type of the first exception
      T2 - the type of the second exception
      T3 - the type of the third exception
      T4 - the type of the fourth 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
      supplier - the supplier
      Returns:
      the supplied value
      Throws:
      T1 - if the supplier throws an unchecked exception with this cause
      T2 - if the supplier throws an unchecked exception with this cause
      T3 - if the supplier throws an unchecked exception with this cause
      T4 - if the supplier throws an unchecked exception with this cause
    • check

      public static <R, T1 extends Throwable, T2 extends Throwable, T3 extends Throwable, T4 extends Throwable, T5 extends Throwable> R check(Class<? extends T1> exception1, Class<? extends T2> exception2, Class<? extends T3> exception3, Class<? extends T4> exception4, Class<? extends T5> exception5, Supplier<? extends R> supplier) throws T1, T2, T3, T4, T5
      Runs a supplier and makes five unchecked exceptions into checked.
      Type Parameters:
      R - the type of the return type of the supplied value
      T1 - the type of the first exception
      T2 - the type of the second exception
      T3 - the type of the third exception
      T4 - the type of the fourth exception
      T5 - the type of the fifth 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
      supplier - the supplier
      Returns:
      the supplied value
      Throws:
      T1 - if the supplier throws an unchecked exception with this cause
      T2 - if the supplier throws an unchecked exception with this cause
      T3 - if the supplier throws an unchecked exception with this cause
      T4 - if the supplier throws an unchecked exception with this cause
      T5 - if the supplier throws an unchecked exception with this cause
    • check

      public static <R, T1 extends Throwable, T2 extends Throwable, T3 extends Throwable, T4 extends Throwable, T5 extends Throwable, T6 extends Throwable> R 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, Supplier<? extends R> supplier) throws T1, T2, T3, T4, T5, T6
      Runs a supplier and makes six unchecked exceptions into checked.
      Type Parameters:
      R - the type of the return type of the supplied value
      T1 - the type of the first exception
      T2 - the type of the second exception
      T3 - the type of the third exception
      T4 - the type of the fourth exception
      T5 - the type of the fifth exception
      T6 - the type of the sixth 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
      supplier - the supplier
      Returns:
      the supplied value
      Throws:
      T1 - if the supplier throws an unchecked exception with this cause
      T2 - if the supplier throws an unchecked exception with this cause
      T3 - if the supplier throws an unchecked exception with this cause
      T4 - if the supplier throws an unchecked exception with this cause
      T5 - if the supplier throws an unchecked exception with this cause
      T6 - if the supplier throws an unchecked exception with this cause
    • check

      public static <R, T1 extends Throwable, T2 extends Throwable, T3 extends Throwable, T4 extends Throwable, T5 extends Throwable, T6 extends Throwable, T7 extends Throwable> R 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, Supplier<? extends R> supplier) throws T1, T2, T3, T4, T5, T6, T7
      Runs a supplier and makes seven unchecked exceptions into checked.
      Type Parameters:
      R - the type of the return type of the supplied value
      T1 - the type of the first exception
      T2 - the type of the second exception
      T3 - the type of the third exception
      T4 - the type of the fourth exception
      T5 - the type of the fifth exception
      T6 - the type of the sixth exception
      T7 - the type of the seventh 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
      supplier - the supplier
      Returns:
      the supplied value
      Throws:
      T1 - if the supplier throws an unchecked exception with this cause
      T2 - if the supplier throws an unchecked exception with this cause
      T3 - if the supplier throws an unchecked exception with this cause
      T4 - if the supplier throws an unchecked exception with this cause
      T5 - if the supplier throws an unchecked exception with this cause
      T6 - if the supplier throws an unchecked exception with this cause
      T7 - if the supplier throws an unchecked exception with this cause