Package org.dellroad.stuff.java
Class CheckedExceptionWrapper
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
org.dellroad.stuff.java.CheckedExceptionWrapper
- All Implemented Interfaces:
Serializable
Wraps checked exceptions so they can be thrown across API methods that don't declare them.
- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionGet the wrapped exception.void
Throw the wrapped exception.Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
CheckedExceptionWrapper
Constructor.- Parameters:
exception
- the checked exception to wrap- Throws:
IllegalArgumentException
- ifexception
isnull
-
-
Method Details
-
getException
Get the wrapped exception.- Returns:
- the wrapped checked exception
-
throwException
Throw the wrapped exception.- Throws:
Exception
- always
-