E
- task payload type.public class Task<E>
extends java.lang.Object
WorkQueue
task.Constructor and Description |
---|
Task(java.lang.String taskId,
E payload)
Constructs a new task instance.
|
Modifier and Type | Method and Description |
---|---|
<F> Task<F> |
map(java.util.function.Function<E,F> mapper)
Maps task from one payload type to another.
|
E |
payload()
Returns the task payload.
|
java.lang.String |
taskId()
Returns the task identifier.
|
java.lang.String |
toString() |
public Task(java.lang.String taskId, E payload)
taskId
- task identifierpayload
- task payloadpublic java.lang.String taskId()
public E payload()
public <F> Task<F> map(java.util.function.Function<E,F> mapper)
F
- future typemapper
- type mapper.public java.lang.String toString()
toString
in class java.lang.Object