Builder
public static class Builder
源码Source
io/agentscope/core/model/transport/ProxyConfig.java:339–438ProxyConfig的构建器。位于 io.agentscope.core.model.transport 包。核心成员包括 type、host、port、username、password、nonProxyHosts。
Builder for ProxyConfig.
方法摘要Method Summary
| 方法Method | 说明Description |
|---|---|
public Builder type(ProxyType type) | 设置代理类型。 Set the proxy type. |
public Builder host(String host) | 设置该配置项。 Set the proxy server hostname or IP address. |
public Builder port(int port) | 设置该配置项。 Set the proxy server port. |
public Builder username(String username) | 设置该配置项。 Set the authentication username. |
public Builder password(String password) | 设置密码。 Set the authentication password. |
public Builder nonProxyHosts(Set<String> nonProxyHosts) | 设置该配置项。 Set the hosts that should bypass the proxy. |
public ProxyConfig build() | 构建ProxyConfig。 Build the ProxyConfig. |
方法详情Method Detail
type
public Builder type(ProxyType type)
设置代理类型。
Set the proxy type.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
type | ProxyType | 代理类型。the proxy type |
Builder返回当前实例,以支持链式调用。this builder
源码Source
io/agentscope/core/model/transport/ProxyConfig.java:355–358host
public Builder host(String host)
设置该配置项。
Set the proxy server hostname or IP address.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
host | String | host(类型 `String`)。the proxy host |
Builder返回当前实例,以支持链式调用。this builder
源码Source
io/agentscope/core/model/transport/ProxyConfig.java:366–369port
public Builder port(int port)
设置该配置项。
Set the proxy server port.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
port | int | port(类型 `int`)。the proxy port |
Builder返回当前实例,以支持链式调用。this builder
源码Source
io/agentscope/core/model/transport/ProxyConfig.java:377–380username
public Builder username(String username)
设置该配置项。
Set the authentication username.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
username | String | username(类型 `String`)。the username |
Builder返回当前实例,以支持链式调用。this builder
源码Source
io/agentscope/core/model/transport/ProxyConfig.java:388–391password
public Builder password(String password)
设置密码。
Set the authentication password.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
password | String | 密码。the password |
Builder返回当前实例,以支持链式调用。this builder
源码Source
io/agentscope/core/model/transport/ProxyConfig.java:399–402nonProxyHosts
public Builder nonProxyHosts(Set<String> nonProxyHosts)
设置该配置项。
Set the hosts that should bypass the proxy.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
nonProxyHosts | Set<String> | non 代理 Hosts(类型 `Set`)。the set of non-proxy hosts |
Builder返回当前实例,以支持链式调用。this builder
源码Source
io/agentscope/core/model/transport/ProxyConfig.java:418–421build
public ProxyConfig build()
构建ProxyConfig。
Build the ProxyConfig.
ProxyConfig一种新的ProxyConfig 实例。a new ProxyConfig instance
NullPointerException可能抛出 `NullPointerException`。if type or host is nullIllegalArgumentException可能抛出 `IllegalArgumentException`。if port is out of range
源码Source
io/agentscope/core/model/transport/ProxyConfig.java:430–437