Package com.github.workerframework.api
Enum Class TaskStatus
- All Implemented Interfaces:
Serializable
,Comparable<TaskStatus>
,Constable
The state of a worker thread upon termination.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionThe task data failed validation or could not be understood.This is a new task that requires work.The worker failed at a task because of an unhandled exception.The worker explicitly failed at a task.The worker succeeded at performing a task. -
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
isResult
(TaskStatus status) Determine if this TaskStatus classifies as a resultstatic boolean
isSuccessfulResponse
(TaskStatus status) Determine if a TaskStatus classifies as a successful responsestatic TaskStatus
Returns the enum constant of this class with the specified name.static TaskStatus[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
NEW_TASK
This is a new task that requires work. -
INVALID_TASK
The task data failed validation or could not be understood. -
RESULT_SUCCESS
The worker succeeded at performing a task. -
RESULT_FAILURE
The worker explicitly failed at a task. -
RESULT_EXCEPTION
The worker failed at a task because of an unhandled exception.
-
-
Method Details
-
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
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 nameNullPointerException
- if the argument is null
-
isResult
Determine if this TaskStatus classifies as a result- Parameters:
status
- the TaskStatus to inspect- Returns:
- whether this TaskStatus classifies as a result
-
isSuccessfulResponse
Determine if a TaskStatus classifies as a successful response- Parameters:
status
- the TaskStatus to inspect- Returns:
- whether this TaskStatus classifies as a successful response
-