java.lang.Object
io.hotmoka.exceptions.CheckSupplier
Methods that check an unchecked exception thrown by a supplier.
-
Method Summary
Modifier and TypeMethodDescriptionstatic <R,T extends Throwable>
RRuns a supplier and makes an unchecked exception into checked.static <R,T1 extends Throwable, T2 extends Throwable, T3 extends Throwable, T4 extends Throwable, T5 extends Throwable, T6 extends Throwable, T7 extends Throwable>
Rcheck(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) Runs a supplier and makes seven unchecked exceptions into checked.static <R,T1 extends Throwable, T2 extends Throwable, T3 extends Throwable, T4 extends Throwable, T5 extends Throwable, T6 extends Throwable>
Rcheck(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) Runs a supplier and makes six unchecked exceptions into checked.static <R,T1 extends Throwable, T2 extends Throwable, T3 extends Throwable, T4 extends Throwable, T5 extends Throwable>
Rcheck(Class<? extends T1> exception1, Class<? extends T2> exception2, Class<? extends T3> exception3, Class<? extends T4> exception4, Class<? extends T5> exception5, Supplier<? extends R> supplier) Runs a supplier and makes five unchecked exceptions into checked.check(Class<? extends T1> exception1, Class<? extends T2> exception2, Class<? extends T3> exception3, Class<? extends T4> exception4, Supplier<? extends R> supplier) Runs a supplier and makes four unchecked exceptions into checked.check(Class<? extends T1> exception1, Class<? extends T2> exception2, Class<? extends T3> exception3, Supplier<? extends R> supplier) Runs a supplier and makes three unchecked exceptions into checked.check(Class<? extends T1> exception1, Class<? extends T2> exception2, Supplier<? extends R> supplier) Runs a supplier and makes two unchecked exceptions into checked.
-
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 valueT- the type of the exception- Parameters:
exception- the class of the exceptionsupplier- 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, R checkT2 extends Throwable> (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 valueT1- the type of the first exceptionT2- the type of the second exception- Parameters:
exception1- the class of the first exceptionexception2- the class of the second exceptionsupplier- the supplier- Returns:
- the supplied value
- Throws:
T1- if the supplier throws an unchecked exception with this causeT2- if the supplier throws an unchecked exception with this cause
-
check
public static <R,T1 extends Throwable, R checkT2 extends Throwable, T3 extends Throwable> (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 valueT1- the type of the first exceptionT2- the type of the second exceptionT3- the type of the third exception- Parameters:
exception1- the class of the first exceptionexception2- the class of the second exceptionexception3- the class of the third exceptionsupplier- the supplier- Returns:
- the supplied value
- Throws:
T1- if the supplier throws an unchecked exception with this causeT2- if the supplier throws an unchecked exception with this causeT3- if the supplier throws an unchecked exception with this cause
-
check
public static <R,T1 extends Throwable, R checkT2 extends Throwable, T3 extends Throwable, T4 extends Throwable> (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 valueT1- the type of the first exceptionT2- the type of the second exceptionT3- the type of the third exceptionT4- the type of the fourth exception- Parameters:
exception1- the class of the first exceptionexception2- the class of the second exceptionexception3- the class of the third exceptionexception4- the class of the fourth exceptionsupplier- the supplier- Returns:
- the supplied value
- Throws:
T1- if the supplier throws an unchecked exception with this causeT2- if the supplier throws an unchecked exception with this causeT3- if the supplier throws an unchecked exception with this causeT4- if the supplier throws an unchecked exception with this cause
-
check
public static <R,T1 extends Throwable, R checkT2 extends Throwable, T3 extends Throwable, T4 extends Throwable, T5 extends Throwable> (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 valueT1- the type of the first exceptionT2- the type of the second exceptionT3- the type of the third exceptionT4- the type of the fourth exceptionT5- the type of the fifth exception- Parameters:
exception1- the class of the first exceptionexception2- the class of the second exceptionexception3- the class of the third exceptionexception4- the class of the fourth exceptionexception5- the class of the fifth exceptionsupplier- the supplier- Returns:
- the supplied value
- Throws:
T1- if the supplier throws an unchecked exception with this causeT2- if the supplier throws an unchecked exception with this causeT3- if the supplier throws an unchecked exception with this causeT4- if the supplier throws an unchecked exception with this causeT5- if the supplier throws an unchecked exception with this cause
-
check
public static <R,T1 extends Throwable, R checkT2 extends Throwable, T3 extends Throwable, T4 extends Throwable, T5 extends Throwable, T6 extends Throwable> (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 valueT1- the type of the first exceptionT2- the type of the second exceptionT3- the type of the third exceptionT4- the type of the fourth exceptionT5- the type of the fifth exceptionT6- the type of the sixth exception- Parameters:
exception1- the class of the first exceptionexception2- the class of the second exceptionexception3- the class of the third exceptionexception4- the class of the fourth exceptionexception5- the class of the fifth exceptionexception6- the class of the sixth exceptionsupplier- the supplier- Returns:
- the supplied value
- Throws:
T1- if the supplier throws an unchecked exception with this causeT2- if the supplier throws an unchecked exception with this causeT3- if the supplier throws an unchecked exception with this causeT4- if the supplier throws an unchecked exception with this causeT5- if the supplier throws an unchecked exception with this causeT6- if the supplier throws an unchecked exception with this cause
-
check
public static <R,T1 extends Throwable, R checkT2 extends Throwable, T3 extends Throwable, T4 extends Throwable, T5 extends Throwable, T6 extends Throwable, T7 extends Throwable> (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 valueT1- the type of the first exceptionT2- the type of the second exceptionT3- the type of the third exceptionT4- the type of the fourth exceptionT5- the type of the fifth exceptionT6- the type of the sixth exceptionT7- the type of the seventh exception- Parameters:
exception1- the class of the first exceptionexception2- the class of the second exceptionexception3- the class of the third exceptionexception4- the class of the fourth exceptionexception5- the class of the fifth exceptionexception6- the class of the sixth exceptionexception7- the class of the seventh exceptionsupplier- the supplier- Returns:
- the supplied value
- Throws:
T1- if the supplier throws an unchecked exception with this causeT2- if the supplier throws an unchecked exception with this causeT3- if the supplier throws an unchecked exception with this causeT4- if the supplier throws an unchecked exception with this causeT5- if the supplier throws an unchecked exception with this causeT6- if the supplier throws an unchecked exception with this causeT7- if the supplier throws an unchecked exception with this cause
-