Package io.activej.common.function
Interface RunnableEx
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
Represents a
Runnable capable of throwing exceptions-
Method Summary
Modifier and TypeMethodDescriptionstatic RunnableExCreates aRunnableExout ofRunnablevoidrun()static RunnableuncheckedOf(RunnableEx checkedFn) Creates aRunnableout ofRunnableEx
-
Method Details
-
run
- Throws:
Exception
-
of
Creates aRunnableExout ofRunnableIf given runnable throws
UncheckedException, its cause will be propagated- Parameters:
uncheckedFn- originalRunnable- Returns:
- a runnable capable of throwing exceptions
-
uncheckedOf
Creates aRunnableout ofRunnableExIf given runnable throws a checked exception, it will be wrapped into
UncheckedExceptionand rethrownUnchecked exceptions will be handled by thread's
FatalErrorHandler- Parameters:
checkedFn- originalRunnableEx- Returns:
- a runnable
-