Package com.complexible.common.base
Class Exceptions
java.lang.Object
com.complexible.common.base.Exceptions
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T extends Throwable>
RuntimeExceptionRethrow a checked exception without wrapping into an unchecked exception, bypassing the Java compiler's checks.
-
Method Details
-
rethrowChecked
Rethrow a checked exception without wrapping into an unchecked exception, bypassing the Java compiler's checks. This method is particularly useful in lambdas, which are defined not throwing any checked exceptions, e. g.Map.compute(Object, BiFunction). This method will never return anything, it will just throw the exception that was passed to it as an argument. This method is defined to return RuntimeException to allow the following code: ... catch (IOException e) { throw Exceptions.rethrowChecked(e); }- Throws:
T
-