T
- Type of result returnedpublic class RunnableCallableAdapter<T> extends java.lang.Object implements java.util.concurrent.Callable<T>, RunnableContainer
Runnable
with a result into a Callable
. This is similar to
Executors.callable(Runnable, Object)
, except this implementation
also implements the RunnableContainer
interface.Constructor and Description |
---|
RunnableCallableAdapter(java.lang.Runnable runnable)
Constructs a new adapter with a provided runnable to execute.
|
RunnableCallableAdapter(java.lang.Runnable runnable,
T result)
Constructs a new adapter with a provided runnable to execute, and an optional result.
|
Modifier and Type | Method and Description |
---|---|
T |
call() |
java.lang.Runnable |
getContainedRunnable()
Call to get the contained runnable within the wrapper.
|
public RunnableCallableAdapter(java.lang.Runnable runnable)
null
.runnable
- Runnable to be invoked when this adapter is ranpublic RunnableCallableAdapter(java.lang.Runnable runnable, T result)
runnable
- Runnable to be invoked when this adapter is ranresult
- Result to return from runnable or null
public java.lang.Runnable getContainedRunnable()
RunnableContainer
getContainedRunnable
in interface RunnableContainer
null
if none is contained