Class Task<E>

  • Type Parameters:
    E - task payload type.

    public class Task<E>
    extends Object
    WorkQueue task.
    • Constructor Detail

      • Task

        public Task​(String taskId,
                    E payload)
        Constructs a new task instance.
        Parameters:
        taskId - task identifier
        payload - task payload
    • Method Detail

      • taskId

        public 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​(Function<E,​F> mapper)
        Maps task from one payload type to another.
        Type Parameters:
        F - future type
        Parameters:
        mapper - type mapper.
        Returns:
        mapped task.