Package com.pivovarit.function
Interface ThrowingRunnable<E extends Exception>
- Type Parameters:
E
- the type of the thrown checked exception
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
Represents an action that can be performed.
Function might throw a checked exception instance.
-
Method Summary
Modifier and TypeMethodDescriptionvoid
run()
static Runnable
sneaky
(ThrowingRunnable<?> runnable) Returns a new Runnable instance which rethrows the checked exception using the Sneaky Throws patterndefault Runnable
static Runnable
unchecked
(ThrowingRunnable<?> runnable)
-
Method Details
-
run
void run() throws E- Throws:
E
-
unchecked
-
sneaky
Returns a new Runnable instance which rethrows the checked exception using the Sneaky Throws pattern- Returns:
- Runnable instance that rethrows the checked exception using the Sneaky Throws pattern
-
unchecked
- Returns:
- a new Runnable instance which wraps thrown checked exception instance into a RuntimeException
-