@FunctionalInterface public static interface Throwing.Runnable extends Runnable
Runnable.| Modifier and Type | Method and Description |
|---|---|
default <X extends Throwable> |
onFailure(Class<? extends X> type,
Consumer<X> action)
Execute the given action before throwing the exception.
|
default Throwing.Runnable |
onFailure(Consumer<Throwable> action)
Execute the given action before throwing the exception.
|
default void |
run() |
void |
tryRun() |
default <X extends Throwable> |
unwrap(Class<? extends X> type)
Unwrap an exception and rethrow.
|
default Throwing.Runnable |
wrap(Function<Throwable,Exception> wrapper)
Wrap an exception as new exception provided by the given wrap function.
|
default Throwing.Runnable onFailure(Consumer<Throwable> action)
action - Action to execute.default <X extends Throwable> Throwing.Runnable onFailure(Class<? extends X> type, Consumer<X> action)
X - Exception type.type - Exception type filter.action - Action to execute.default Throwing.Runnable wrap(Function<Throwable,Exception> wrapper)
wrapper - Wrap function.default <X extends Throwable> Throwing.Runnable unwrap(Class<? extends X> type)
X - Exception type.type - Type to unwrap.Copyright © 2017. All rights reserved.