@FunctionalInterface public interface Block
Similar to Runnable
, but allows throwing of checked exceptions.
Modifier and Type | Method and Description |
---|---|
void |
execute()
Execute the action.
|
static Block |
noop() |
static Block |
throwException(Throwable throwable)
Returns an action that immediately throws the given exception.
|
default Runnable |
toRunnable()
Converts this action to a runnable.
|
static Block noop()
static Block throwException(Throwable throwable)
The exception is thrown via Exceptions.toException(Throwable)
throwable
- the throwable to immediately throw when the returned action is executed