Class WrappedCheckedException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
io.github.cowwoc.pouch10.core.WrappedCheckedException
- All Implemented Interfaces:
Serializable
A runtime exception dedicated to wrapping checked exceptions.
- See Also:
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionstatic RunnableWraps any checked exceptions thrown by aThrowingRunnable.static RuntimeExceptionWraps an exception, unless it is aRuntimeExceptionwith the specifiedmessage.static RuntimeExceptionWraps an exception, unless it is aRuntimeException.static <V> Supplier<V> Wraps any checked exceptions thrown by aCallable.Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Method Details
-
wrap
Wraps any checked exceptions thrown by aCallable.- Type Parameters:
V- the type of value returned bytask- Parameters:
task- the task to execute- Returns:
- a
Callablethat does not throw any checked exceptions - Throws:
NullPointerException- iftaskis null
-
wrap
Wraps any checked exceptions thrown by aThrowingRunnable.- Parameters:
task- the task to execute- Returns:
- a
Runnable - Throws:
NullPointerException- iftaskis null
-
wrap
Wraps an exception, unless it is aRuntimeException.- Parameters:
t- the exception to wrap- Returns:
- the updated exception
- Throws:
NullPointerException- iftis null
-
wrap
Wraps an exception, unless it is aRuntimeExceptionwith the specifiedmessage.- Parameters:
message- the detail message of the WrappedCheckedExceptiont- the exception to wrap- Returns:
- the updated exception
- Throws:
NullPointerException- iftis null
-