@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.| 限定符和类型 | 方法和说明 |
|---|---|
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 © 2024 The Apache Software Foundation. All rights reserved.