Package com.pivovarit.function
Interface ThrowingRunnable<E extends java.lang.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.
@FunctionalInterface public interface ThrowingRunnable<E extends java.lang.Exception>
Represents an action that can be performed. Function might throw a checked exception instance.
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description void
run()
static java.lang.Runnable
sneaky(ThrowingRunnable<?> runnable)
Returns a new Runnable instance which rethrows the checked exception using the Sneaky Throws patterndefault java.lang.Runnable
unchecked()
static java.lang.Runnable
unchecked(ThrowingRunnable<?> runnable)
-
-
-
Method Detail
-
unchecked
static java.lang.Runnable unchecked(ThrowingRunnable<?> runnable)
-
sneaky
static java.lang.Runnable sneaky(ThrowingRunnable<?> runnable)
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
default java.lang.Runnable unchecked()
- Returns:
- a new Runnable instance which wraps thrown checked exception instance into a RuntimeException
-
-