Interface ThrowingRunnable<E extends Throwable>
- Type Parameters:
E
- Exception to be thrown
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
The SDK version of Java's Runnable interface which comes with a throw signature.
Source:
Runnable
The Runnable interface should be implemented by any class whose instances are intended to be executed by a thread.
The class must define a method of no arguments called run.- Since:
- 2.0.0
-
Method Summary
Modifier and TypeMethodDescriptionvoid
run()
When an object implementing interfaceRunnable
is used to create a thread, starting the thread causes the object'srun
method to be called in that separately executing thread.unchecked
(ThrowingRunnable<E> f) Call to run() method with try-catch for unchecked exceptions.
-
Method Details
-
run
When an object implementing interfaceRunnable
is used to create a thread, starting the thread causes the object'srun
method to be called in that separately executing thread.The general contract of the method
run
is that it may take any action whatsoever.- Throws:
E
- Exception to be thrown- See Also:
-
unchecked
Call to run() method with try-catch for unchecked exceptions.- Type Parameters:
E
- Exception to be thrown- Parameters:
f
- ThrowingRunnable object with exception E- Returns:
- Runnable
-