Class A2ACardResolver.Builder

java.lang.Object
org.a2aproject.sdk.client.http.A2ACardResolver.Builder
Enclosing class:
A2ACardResolver

public static class A2ACardResolver.Builder extends Object
Builder for creating A2ACardResolver instances with a fluent API.
  • Method Details

    • httpClient

      public A2ACardResolver.Builder httpClient(A2AHttpClient httpClient)
      Sets the HTTP client to use for fetching agent cards. If not called, a default client is created via A2AHttpClientFactory.create().
      Parameters:
      httpClient - the HTTP client to use
      Returns:
      this builder
    • baseUrl

      public A2ACardResolver.Builder baseUrl(String baseUrl)
      Sets the base URL for the agent.
      Parameters:
      baseUrl - the base URL, must not be null
      Returns:
      this builder
    • tenant

      public A2ACardResolver.Builder tenant(@Nullable String tenant)
      Sets the tenant path to use when fetching the agent card.
      Parameters:
      tenant - the tenant path, may be null for no tenant
      Returns:
      this builder
    • agentCardPath

      public A2ACardResolver.Builder agentCardPath(@Nullable String agentCardPath)
      Sets a custom agent card path relative to the base URL.
      Parameters:
      agentCardPath - the custom agent card path; if null or empty, defaults to /.well-known/agent-card.json
      Returns:
      this builder
    • authHeaders

      public A2ACardResolver.Builder authHeaders(@Nullable Map<String,String> authHeaders)
      Sets the authentication headers to use when fetching the agent card.
      Parameters:
      authHeaders - the authentication headers, may be null
      Returns:
      this builder
    • authHeader

      public A2ACardResolver.Builder authHeader(String name, String value)
      Adds a single authentication header.
      Parameters:
      name - the header name
      value - the header value
      Returns:
      this builder
    • build

      public A2ACardResolver build() throws A2AClientError
      Builds the A2ACardResolver instance.
      Returns:
      a new A2ACardResolver
      Throws:
      A2AClientError - if the configuration is invalid
      IllegalArgumentException - if baseUrl is null