java.lang.Object
io.hotmoka.exceptions.UncheckFunction
This class provides a method to transform a function with exceptions
into a function, by unchecking its exceptions.
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T,R> Function <T, R> uncheck(FunctionWithExceptions<? super T, ? extends R> wrapped) Transforms a function with exceptions into a function without checked exceptions.uncheck(Class<E> exception, FunctionWithExceptions1<? super T, ? extends R, E> wrapped) Transforms a function with exceptions into a function without checked exceptions.uncheck(Class<E1> exception1, Class<E2> exception2, FunctionWithExceptions2<? super T, ? extends R, E1, E2> wrapped) Transforms a function with exceptions into a function without checked exceptions.uncheck(Class<E1> exception1, Class<E2> exception2, Class<E3> exception3, FunctionWithExceptions3<? super T, ? extends R, E1, E2, E3> wrapped) Transforms a function with exceptions into a function without checked exceptions.static <T,R, E1 extends Throwable, E2 extends Throwable, E3 extends Throwable, E4 extends Throwable>
Function<T, R> uncheck(Class<E1> exception1, Class<E2> exception2, Class<E3> exception3, Class<E4> exception4, FunctionWithExceptions4<? super T, ? extends R, E1, E2, E3, E4> wrapped) Transforms a function with exceptions into a function without checked exceptions.static <T,R, E1 extends Throwable, E2 extends Throwable, E3 extends Throwable, E4 extends Throwable, E5 extends Throwable>
Function<T, R> uncheck(Class<E1> exception1, Class<E2> exception2, Class<E3> exception3, Class<E4> exception4, Class<E5> exception5, FunctionWithExceptions5<? super T, ? extends R, E1, E2, E3, E4, E5> wrapped) Transforms a function with exceptions into a function without checked exceptions.static <T,R, E1 extends Throwable, E2 extends Throwable, E3 extends Throwable, E4 extends Throwable, E5 extends Throwable, E6 extends Throwable>
Function<T, R> uncheck(Class<E1> exception1, Class<E2> exception2, Class<E3> exception3, Class<E4> exception4, Class<E5> exception5, Class<E6> exception6, FunctionWithExceptions6<? super T, ? extends R, E1, E2, E3, E4, E5, E6> wrapped) Transforms a function with exceptions into a function without checked exceptions.static <T,R, E1 extends Throwable, E2 extends Throwable, E3 extends Throwable, E4 extends Throwable, E5 extends Throwable, E6 extends Throwable, E7 extends Throwable>
Function<T, R> uncheck(Class<E1> exception1, Class<E2> exception2, Class<E3> exception3, Class<E4> exception4, Class<E5> exception5, Class<E6> exception6, Class<E7> exception7, FunctionWithExceptions7<? super T, ? extends R, E1, E2, E3, E4, E5, E6, E7> wrapped) Transforms a function with exceptions into a function without checked exceptions.
-
Method Details
-
uncheck
Transforms a function with exceptions into a function without checked exceptions. This means that all checked exceptions get wrapped into aUncheckedException. They can later be recovered through a method fromCheckRunnableorCheckSupplier.- Type Parameters:
T- the type of the parameter of the functionR- the type of the result of the function- Parameters:
wrapped- the function with exceptions- Returns:
- the function without exceptions
-
uncheck
public static <T,R, Function<T,E extends Throwable> R> uncheck(Class<E> exception, FunctionWithExceptions1<? super T, ? extends R, E> wrapped) Transforms a function with exceptions into a function without checked exceptions. This means that all checked exceptions get wrapped into aUncheckedException. They can later be recovered through a method fromCheckRunnableorCheckSupplier.- Type Parameters:
T- the type of the parameter of the functionR- the type of the result of the functionE- the type of exceptions that get unchecked- Parameters:
exception- the exception tag ofEwrapped- the function with exceptions- Returns:
- the function without exceptions
-
uncheck
public static <T,R, Function<T,E1 extends Throwable, E2 extends Throwable> R> uncheck(Class<E1> exception1, Class<E2> exception2, FunctionWithExceptions2<? super T, ? extends R, E1, E2> wrapped) Transforms a function with exceptions into a function without checked exceptions. This means that all checked exceptions get wrapped into aUncheckedException. They can later be recovered through a method fromCheckRunnableorCheckSupplier.- Type Parameters:
T- the type of the parameter of the functionR- the type of the result of the functionE1- the first type of exceptions that get uncheckedE2- the second type of exceptions that get unchecked- Parameters:
exception1- the exception tag ofE1exception2- the exception tag ofE2wrapped- the function with exceptions- Returns:
- the function without exceptions
-
uncheck
public static <T,R, Function<T,E1 extends Throwable, E2 extends Throwable, E3 extends Throwable> R> uncheck(Class<E1> exception1, Class<E2> exception2, Class<E3> exception3, FunctionWithExceptions3<? super T, ? extends R, E1, E2, E3> wrapped) Transforms a function with exceptions into a function without checked exceptions. This means that all checked exceptions get wrapped into aUncheckedException. They can later be recovered through a method fromCheckRunnableorCheckSupplier.- Type Parameters:
T- the type of the parameter of the functionR- the type of the result of the functionE1- the first type of exceptions that get uncheckedE2- the second type of exceptions that get uncheckedE3- the third type of exceptions that get unchecked- Parameters:
exception1- the exception tag ofE1exception2- the exception tag ofE2exception3- the exception tag ofE3wrapped- the function with exceptions- Returns:
- the function without exceptions
-
uncheck
public static <T,R, Function<T,E1 extends Throwable, E2 extends Throwable, E3 extends Throwable, E4 extends Throwable> R> uncheck(Class<E1> exception1, Class<E2> exception2, Class<E3> exception3, Class<E4> exception4, FunctionWithExceptions4<? super T, ? extends R, E1, E2, E3, E4> wrapped) Transforms a function with exceptions into a function without checked exceptions. This means that all checked exceptions get wrapped into aUncheckedException. They can later be recovered through a method fromCheckRunnableorCheckSupplier.- Type Parameters:
T- the type of the parameter of the functionR- the type of the result of the functionE1- the first type of exceptions that get uncheckedE2- the second type of exceptions that get uncheckedE3- the third type of exceptions that get uncheckedE4- the fourth type of exceptions that get unchecked- Parameters:
exception1- the exception tag ofE1exception2- the exception tag ofE2exception3- the exception tag ofE3exception4- the exception tag ofE4wrapped- the function with exceptions- Returns:
- the function without exceptions
-
uncheck
public static <T,R, Function<T,E1 extends Throwable, E2 extends Throwable, E3 extends Throwable, E4 extends Throwable, E5 extends Throwable> R> uncheck(Class<E1> exception1, Class<E2> exception2, Class<E3> exception3, Class<E4> exception4, Class<E5> exception5, FunctionWithExceptions5<? super T, ? extends R, E1, E2, E3, E4, E5> wrapped) Transforms a function with exceptions into a function without checked exceptions. This means that all checked exceptions get wrapped into aUncheckedException. They can later be recovered through a method fromCheckRunnableorCheckSupplier.- Type Parameters:
T- the type of the parameter of the functionR- the type of the result of the functionE1- the first type of exceptions that get uncheckedE2- the second type of exceptions that get uncheckedE3- the third type of exceptions that get uncheckedE4- the fourth type of exceptions that get uncheckedE5- the fifth type of exceptions that get unchecked- Parameters:
exception1- the exception tag ofE1exception2- the exception tag ofE2exception3- the exception tag ofE3exception4- the exception tag ofE4exception5- the exception tag ofE5wrapped- the function with exceptions- Returns:
- the function without exceptions
-
uncheck
public static <T,R, Function<T,E1 extends Throwable, E2 extends Throwable, E3 extends Throwable, E4 extends Throwable, E5 extends Throwable, E6 extends Throwable> R> uncheck(Class<E1> exception1, Class<E2> exception2, Class<E3> exception3, Class<E4> exception4, Class<E5> exception5, Class<E6> exception6, FunctionWithExceptions6<? super T, ? extends R, E1, E2, E3, E4, E5, E6> wrapped) Transforms a function with exceptions into a function without checked exceptions. This means that all checked exceptions get wrapped into aUncheckedException. They can later be recovered through a method fromCheckRunnableorCheckSupplier.- Type Parameters:
T- the type of the parameter of the functionR- the type of the result of the functionE1- the first type of exceptions that get uncheckedE2- the second type of exceptions that get uncheckedE3- the third type of exceptions that get uncheckedE4- the fourth type of exceptions that get uncheckedE5- the fifth type of exceptions that get uncheckedE6- the sixth type of exceptions that get unchecked- Parameters:
exception1- the exception tag ofE1exception2- the exception tag ofE2exception3- the exception tag ofE3exception4- the exception tag ofE4exception5- the exception tag ofE5exception6- the exception tag ofE6wrapped- the function with exceptions- Returns:
- the function without exceptions
-
uncheck
public static <T,R, Function<T,E1 extends Throwable, E2 extends Throwable, E3 extends Throwable, E4 extends Throwable, E5 extends Throwable, E6 extends Throwable, E7 extends Throwable> R> uncheck(Class<E1> exception1, Class<E2> exception2, Class<E3> exception3, Class<E4> exception4, Class<E5> exception5, Class<E6> exception6, Class<E7> exception7, FunctionWithExceptions7<? super T, ? extends R, E1, E2, E3, E4, E5, E6, E7> wrapped) Transforms a function with exceptions into a function without checked exceptions. This means that all checked exceptions get wrapped into aUncheckedException. They can later be recovered through a method fromCheckRunnableorCheckSupplier.- Type Parameters:
T- the type of the parameter of the functionR- the type of the result of the functionE1- the first type of exceptions that get uncheckedE2- the second type of exceptions that get uncheckedE3- the third type of exceptions that get uncheckedE4- the fourth type of exceptions that get uncheckedE5- the fifth type of exceptions that get uncheckedE6- the sixth type of exceptions that get uncheckedE7- the seventh type of exceptions that get unchecked- Parameters:
exception1- the exception tag ofE1exception2- the exception tag ofE2exception3- the exception tag ofE3exception4- the exception tag ofE4exception5- the exception tag ofE5exception6- the exception tag ofE6exception7- the exception tag ofE7wrapped- the function with exceptions- Returns:
- the function without exceptions
-