Package io.github.suppierk.java.util
Interface ExceptionSuppressor
public interface ExceptionSuppressor
Small utility taken from Apache commons-lang ExceptionUtils class
-
Method Summary
Static MethodsModifier and TypeMethodDescriptionstatic <R,
T extends Throwable>
RasUnchecked
(Throwable throwable) Claim a Throwable is another Exception type using type erasure.
-
Method Details
-
asUnchecked
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 compiler
-