Package org.a2aproject.sdk.spec
Class AgentExtension.Builder
java.lang.Object
org.a2aproject.sdk.spec.AgentExtension.Builder
- Enclosing class:
- AgentExtension
Builder for constructing immutable
AgentExtension instances.
Example usage:
AgentExtension ext = AgentExtension.builder()
.uri("https://example.com/extensions/custom-auth")
.description("Custom authentication extension")
.required(true)
.params(Map.of("authType", "bearer"))
.build();
-
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds a new immutableAgentExtensionfrom the current builder state.description(String description) Sets a human-readable description of the extension's purpose.Sets configuration parameters for the extension.required(boolean required) Sets whether support for this extension is mandatory.Sets the unique identifier URI for this extension.
-
Method Details
-
description
Sets a human-readable description of the extension's purpose.- Parameters:
description- the extension description (optional)- Returns:
- this builder for method chaining
-
params
Sets configuration parameters for the extension.- Parameters:
params- map of parameter key-value pairs (optional)- Returns:
- this builder for method chaining
-
required
Sets whether support for this extension is mandatory.- Parameters:
required- true if clients must support this extension (defaults to false)- Returns:
- this builder for method chaining
-
uri
Sets the unique identifier URI for this extension.- Parameters:
uri- the extension URI (required)- Returns:
- this builder for method chaining
-
build
Builds a new immutableAgentExtensionfrom the current builder state.- Returns:
- a new AgentExtension instance
- Throws:
IllegalArgumentException- if uri is null
-