public class JkRunnables<T>
extends java.lang.Object
implements java.lang.Runnable
Runnable
. From this object you can replace the underlying Runnable
or
chain it with other ones.Modifier and Type | Method and Description |
---|---|
JkRunnables<T> |
append(java.lang.Runnable chainedRunnable)
Chains this underlying
Runnable with the specified one. |
static JkRunnables<java.lang.Void> |
of()
Creates a
JkRunnables delegating to a no-op runnable. |
static JkRunnables<java.lang.Void> |
of(java.lang.Runnable runnable)
Creates a
JkRunnables delegating to the single specified Runnable . |
static <T> JkRunnables<T> |
of(T parent,
java.lang.Runnable runnable)
Same as
of(Runnable) but providing a parent chaining. |
static <T> JkRunnables<T> |
ofParent(T parent)
Same as
of() but providing parent chaining |
JkRunnables<T> |
prepend(java.lang.Runnable chainedRunnable)
Chains this specified
Runnable with the underlying one. |
void |
run() |
JkRunnables<T> |
set(java.lang.Runnable runnable)
Set the specified
Runnable as the unique underlying Runnable for this container. |
public final T __
public static JkRunnables<java.lang.Void> of(java.lang.Runnable runnable)
JkRunnables
delegating to the single specified Runnable
.public static <T> JkRunnables<T> of(T parent, java.lang.Runnable runnable)
of(Runnable)
but providing a parent chaining.public static JkRunnables<java.lang.Void> of()
JkRunnables
delegating to a no-op runnable.public static <T> JkRunnables<T> ofParent(T parent)
of()
but providing parent chainingpublic JkRunnables<T> set(java.lang.Runnable runnable)
Runnable
as the unique underlying Runnable
for this container.public JkRunnables<T> append(java.lang.Runnable chainedRunnable)
Runnable
with the specified one. The specified runnable will
be executed at the end.public JkRunnables<T> prepend(java.lang.Runnable chainedRunnable)
Runnable
with the underlying one. The specified runnable will
be executed first.public void run()
run
in interface java.lang.Runnable