Class CancelTaskRequest.Builder
java.lang.Object
org.a2aproject.sdk.jsonrpc.common.wrappers.CancelTaskRequest.Builder
- Enclosing class:
- CancelTaskRequest
Builder for constructing
CancelTaskRequest instances.
Provides a fluent API for setting request parameters. If no id is provided,
a random UUID will be generated when build() is called.
-
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds a newCancelTaskRequestfrom the current builder state.Sets the request identifier.Sets the JSON-RPC protocol version.params(CancelTaskParams params) Sets the request parameters containing the task ID to cancel.
-
Method Details
-
jsonrpc
Sets the JSON-RPC protocol version.- Parameters:
jsonrpc- the JSON-RPC version (optional, defaults to "2.0")- Returns:
- this builder for method chaining
-
id
Sets the request identifier.- Parameters:
id- the request identifier (string, integer, or null; if null, a UUID will be generated)- Returns:
- this builder for method chaining
-
params
Sets the request parameters containing the task ID to cancel.- Parameters:
params- the request parameters (required)- Returns:
- this builder for method chaining
-
build
Builds a newCancelTaskRequestfrom the current builder state.If no id was provided, a random UUID will be generated.
- Returns:
- a new CancelTaskRequest instance
- Throws:
IllegalArgumentException- if validation fails (invalid method, null params, invalid id type)
-