Enum Class TaskStatus

java.lang.Object
java.lang.Enum<TaskStatus>
com.github.workerframework.api.TaskStatus
All Implemented Interfaces:
Serializable, Comparable<TaskStatus>, Constable

public enum TaskStatus extends Enum<TaskStatus>
The state of a worker thread upon termination.
  • Enum Constant Details

    • NEW_TASK

      public static final TaskStatus NEW_TASK
      This is a new task that requires work.
    • INVALID_TASK

      public static final TaskStatus INVALID_TASK
      The task data failed validation or could not be understood.
    • RESULT_SUCCESS

      public static final TaskStatus RESULT_SUCCESS
      The worker succeeded at performing a task.
    • RESULT_FAILURE

      public static final TaskStatus RESULT_FAILURE
      The worker explicitly failed at a task.
    • RESULT_EXCEPTION

      public static final TaskStatus RESULT_EXCEPTION
      The worker failed at a task because of an unhandled exception.
  • Method Details

    • values

      public static TaskStatus[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static TaskStatus valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • isResult

      public static boolean isResult(TaskStatus status)
      Determine if this TaskStatus classifies as a result
      Parameters:
      status - the TaskStatus to inspect
      Returns:
      whether this TaskStatus classifies as a result
    • isSuccessfulResponse

      public static boolean isSuccessfulResponse(TaskStatus status)
      Determine if a TaskStatus classifies as a successful response
      Parameters:
      status - the TaskStatus to inspect
      Returns:
      whether this TaskStatus classifies as a successful response