Package org.onosproject.store.service
Class Task<E>
- java.lang.Object
-
- org.onosproject.store.service.Task<E>
-
- Type Parameters:
E
- task payload type.
public class Task<E> extends java.lang.Object
WorkQueue
task.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method 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()
-
-
-
Constructor Detail
-
Task
public Task(java.lang.String taskId, E payload)
Constructs a new task instance.- Parameters:
taskId
- task identifierpayload
- task payload
-
-
Method Detail
-
taskId
public java.lang.String taskId()
Returns the task identifier.- Returns:
- task id
-
payload
public E payload()
Returns the task payload.- Returns:
- task payload
-
map
public <F> Task<F> map(java.util.function.Function<E,F> mapper)
Maps task from one payload type to another.- Type Parameters:
F
- future type- Parameters:
mapper
- type mapper.- Returns:
- mapped task.
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-