AI-generated Key Takeaways
-
ApiTaskResult represents the result of a Task, including additional information about the outcome.
-
It can be constructed with just a Status for failed tasks or with a result and a Status for successful tasks.
-
Key methods include getResult() to retrieve the task's result and getStatus() to retrieve the task's status.
A representation of the result of a Task, which includes
additional information about the outcome of the execution.
Public Constructor Summary
|
ApiTaskResult(Status
status)
Creates an instance of
ApiTaskResult
for situations when the Task
fails to return a result.
|
|
|
ApiTaskResult(T result, Status
status)
Creates an instance of
ApiTaskResult
with a result and a status.
|
Public Method Summary
| T |
getResult()
Returns the result of the task.
|
| Status |
getStatus()
Returns the status of the task.
|
| String |
toString()
|
Inherited Method Summary
Public Constructors
public ApiTaskResult (Status status)
Creates an instance of ApiTaskResult
for situations when the Task fails to
return a result.
Parameters
| status | a Status
object contains information about the cause of the failure. |
|---|
public ApiTaskResult (T result, Status status)
Creates an instance of ApiTaskResult
with a result and a status.
Parameters
| result | the result of the task. |
|---|---|
| status | a Status
object with information about the operation. |
Public Methods
public T getResult ()
Returns the result of the task.
Returns
- The result of the task, only present if the task completed successfully.
public Status getStatus ()
Returns the status of the task.
Returns
- The status of the task with information about the result of the operation.