@PublicEvolving @FunctionalInterface public interface ThrowingRunnable<E extends Throwable>
Runnable
, this interface is used to capture a block of code
to be executed. In contrast to Runnable
, this interface allows throwing
checked exceptions.Modifier and Type | Method and Description |
---|---|
void |
run()
The work method.
|
static Runnable |
unchecked(ThrowingRunnable<?> throwingRunnable)
Converts a
ThrowingRunnable into a Runnable which throws all checked exceptions
as unchecked. |
static Runnable unchecked(ThrowingRunnable<?> throwingRunnable)
ThrowingRunnable
into a Runnable
which throws all checked exceptions
as unchecked.Copyright © 2014–2020 The Apache Software Foundation. All rights reserved.