Class GetTaskResponse

java.lang.Object
org.a2aproject.sdk.jsonrpc.common.wrappers.A2AResponse<Task>
org.a2aproject.sdk.jsonrpc.common.wrappers.GetTaskResponse
All Implemented Interfaces:
A2AMessage

public final class GetTaskResponse extends A2AResponse<Task>
JSON-RPC response containing requested task information.

This response returns the full Task object for a task ID queried via GetTaskRequest, including all task metadata, status, artifacts, and messages.

If the task is not found or an error occurs, the error field will be populated with a A2AError (typically TaskNotFoundError) instead of a result.

See Also:
  • Constructor Details

    • GetTaskResponse

      public GetTaskResponse(String jsonrpc, Object id, Task result, A2AError error)
      Constructs response with full parameters.
      Parameters:
      jsonrpc - the JSON-RPC version
      id - the request ID
      result - the task result
      error - the error if any
    • GetTaskResponse

      public GetTaskResponse(Object id, A2AError error)
      Constructs error response.
      Parameters:
      id - the request ID
      error - the error
    • GetTaskResponse

      public GetTaskResponse(Object id, Task result)
      Constructs successful response.
      Parameters:
      id - the request ID
      result - the task result