Package io.github.suppierk.java.util
Interface ExceptionSuppressor
-
public interface ExceptionSuppressor
Small utility taken from Apache commons-lang ExceptionUtils class
-
-
Method Summary
Static Methods Modifier and Type Method Description static <R,T extends java.lang.Throwable>
RasUnchecked(java.lang.Throwable throwable)
Claim a Throwable is another Exception type using type erasure.
-
-
-
Method Detail
-
asUnchecked
static <R,T extends java.lang.Throwable> R asUnchecked(java.lang.Throwable throwable) throws T extends java.lang.Throwable
Claim a Throwable is another Exception type using type erasure. This hides a checked exception from the java compiler, allowing a checked exception to be thrown without having the exception in the method's throw clause.- Type Parameters:
R
- is return type of method caller if neededT
- is exception type to erase- Parameters:
throwable
- is exception to rethrow- Returns:
- nothing
- Throws:
T
- is artificial construct to trick Java compilerT extends java.lang.Throwable
-
-