AS AgentScopeAPI 手册 / API Reference

Builder

public static class Builder
源码Source io/agentscope/core/nacos/a2a/registry/NacosA2aRegistryTransportProperties.java:58–173

构建器用于NacosA2aRegistryTransportProperties。位于 io.agentscope.core.nacos.a2a.registry 包。核心成员包括 transport、host、port、path、supportTls、protocol。

The Builder for NacosA2aRegistryTransportProperties.

Provides a fluent API for constructing instances with various configuration options.

方法摘要Method Summary

方法Method说明Description
public Builder transport(String transport)
设置传输层。
Sets the transport identifier for the A2A endpoint.
public Builder host(String host)
设置该配置项。
Sets the host address for the A2A endpoint.
public Builder port(int port)
设置该配置项。
Sets the port number for the A2A endpoint.
public Builder path(String path)
设置路径。
Sets the path component for the A2A endpoint URL.
public Builder supportTls(boolean supportTls)
设置该配置项。
Sets whether the A2A endpoint supports TLS encryption.
public Builder protocol(String protocol)
设置协议。
Sets the protocol for the A2A endpoint (e.g., http, https).
public Builder query(String query)
设置查询。
Sets the query string for the A2A endpoint URL.
public NacosA2aRegistryTransportProperties build()
构建并返回最终实例。
Builds a new instance of `NacosA2aRegistryTransportProperties` with the configured properties.

方法详情Method Detail

transport

public Builder transport(String transport)

设置传输层。

Sets the transport identifier for the A2A endpoint.

参数Parameters
名称Name类型Type说明Description
transportString传输层(类型 `String`)。the transport identifier
返回Returns Builder
返回当前实例,以支持链式调用。the builder instance for method chaining
源码Source io/agentscope/core/nacos/a2a/registry/NacosA2aRegistryTransportProperties.java:87–90

host

public Builder host(String host)

设置该配置项。

Sets the host address for the A2A endpoint.

参数Parameters
名称Name类型Type说明Description
hostStringhost(类型 `String`)。the host address
返回Returns Builder
返回当前实例,以支持链式调用。the builder instance for method chaining
源码Source io/agentscope/core/nacos/a2a/registry/NacosA2aRegistryTransportProperties.java:98–101

port

public Builder port(int port)

设置该配置项。

Sets the port number for the A2A endpoint.

参数Parameters
名称Name类型Type说明Description
portintport(类型 `int`)。the port number
返回Returns Builder
返回当前实例,以支持链式调用。the builder instance for method chaining
源码Source io/agentscope/core/nacos/a2a/registry/NacosA2aRegistryTransportProperties.java:109–112

path

public Builder path(String path)

设置路径。

Sets the path component for the A2A endpoint URL.

参数Parameters
名称Name类型Type说明Description
pathString路径(类型 `String`)。the path component
返回Returns Builder
返回当前实例,以支持链式调用。the builder instance for method chaining
源码Source io/agentscope/core/nacos/a2a/registry/NacosA2aRegistryTransportProperties.java:120–123

supportTls

public Builder supportTls(boolean supportTls)

设置该配置项。

Sets whether the A2A endpoint supports TLS encryption.

参数Parameters
名称Name类型Type说明Description
supportTlsbooleansupport Tls(类型 `boolean`)。`true` if TLS is supported, `false` otherwise
返回Returns Builder
返回当前实例,以支持链式调用。the builder instance for method chaining
源码Source io/agentscope/core/nacos/a2a/registry/NacosA2aRegistryTransportProperties.java:131–134

protocol

public Builder protocol(String protocol)

设置协议。

Sets the protocol for the A2A endpoint (e.g., http, https).

参数Parameters
名称Name类型Type说明Description
protocolString协议到使用。the protocol to use
返回Returns Builder
返回当前实例,以支持链式调用。the builder instance for method chaining
源码Source io/agentscope/core/nacos/a2a/registry/NacosA2aRegistryTransportProperties.java:142–145

query

public Builder query(String query)

设置查询。

Sets the query string for the A2A endpoint URL.

参数Parameters
名称Name类型Type说明Description
queryString查询文本(类型 `String`)。the query string
返回Returns Builder
返回当前实例,以支持链式调用。the builder instance for method chaining
源码Source io/agentscope/core/nacos/a2a/registry/NacosA2aRegistryTransportProperties.java:153–156

build

public NacosA2aRegistryTransportProperties build()

构建并返回最终实例。

Builds a new instance of NacosA2aRegistryTransportProperties with the configured properties.

返回Returns NacosA2aRegistryTransportProperties
一种新的实例的`NacosA2aRegistryTransportProperties`。a new instance of `NacosA2aRegistryTransportProperties`
抛出Throws
  • IllegalArgumentException 可能抛出 `IllegalArgumentException`。if transport is empty
源码Source io/agentscope/core/nacos/a2a/registry/NacosA2aRegistryTransportProperties.java:166–172
基于官方固定版本源码静态生成Generated from pinned official sources · Python 2.0.11 · Java 2.0.4
签名与文档为静态抽取;如有疑问请以源码为准。Signatures and docs are extracted statically; verify against the source when in doubt.