Class SendMessageRequest.Builder

java.lang.Object
org.a2aproject.sdk.jsonrpc.common.wrappers.SendMessageRequest.Builder
Enclosing class:
SendMessageRequest

public static class SendMessageRequest.Builder extends Object
Builder for constructing SendMessageRequest instances with a fluent API.

The method name is automatically set to "SendMessage" and cannot be changed. If no ID is provided, a UUID will be auto-generated when build() is called.

Example usage:


 SendMessageRequest request = SendMessageRequest.builder()
     .params(new MessageSendParams(message, taskId, taskPushNotificationConfig))
     .build();
 
  • Method Details

    • jsonrpc

      public SendMessageRequest.Builder jsonrpc(String jsonrpc)
      Sets the JSON-RPC version.
      Parameters:
      jsonrpc - the JSON-RPC version (typically "2.0")
      Returns:
      this builder for method chaining
    • id

      Sets the request correlation ID.
      Parameters:
      id - the request correlation identifier
      Returns:
      this builder for method chaining
    • params

      Sets the message send parameters (required).
      Parameters:
      params - the message send parameters
      Returns:
      this builder for method chaining
    • build

      public SendMessageRequest build()
      Builds the SendMessageRequest. Auto-generates a UUID for the ID if not set.
      Returns:
      the constructed request