Class Task<E>

  • Type Parameters:
    E - task payload type.

    public class Task<E>
    extends java.lang.Object
    WorkQueue task.
    • Constructor Summary

      Constructors 
      Constructor Description
      Task​(java.lang.String taskId, E payload)
      Constructs a new task instance.
    • 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()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • Task

        public Task​(java.lang.String taskId,
                    E payload)
        Constructs a new task instance.
        Parameters:
        taskId - task identifier
        payload - 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 class java.lang.Object