@FunctionalInterface
public interface Task
Runnable or Callable.| Modifier and Type | Method and Description |
|---|---|
static Task |
of(java.util.concurrent.Callable callable)
Creates a Task from Callable.
|
static Task |
of(java.lang.Runnable runnable)
Creates a Task from Runnable.
|
void |
run()
Runs a code or throws an exception if unable to do so.
|
default java.util.concurrent.Callable |
toCallable()
Wraps a task into a callable that returns
null. |
default java.lang.Runnable |
toRunnable()
Wraps a task into a runnable.
|
static Task of(java.lang.Runnable runnable)
static Task of(java.util.concurrent.Callable callable)
default java.lang.Runnable toRunnable()
default java.util.concurrent.Callable toCallable()
null.void run() throws java.lang.Exception
java.lang.Exception - if unable to execute taskCopyright © 2003-present Jodd Team