Builder
public static class Builder
源码Source
io/agentscope/examples/compression/extra/CompressingOkHttpTransport.java:435–498CompressingOkHttpTransport的构建器。位于 io.agentscope.examples.compression.extra 包。核心成员包括 transportConfig、compressionConfig、client、enableGzipCompression、build。
Builder for CompressingOkHttpTransport.
方法摘要Method Summary
| 方法Method | 说明Description |
|---|---|
public Builder transportConfig(HttpTransportConfig config) | 设置传输层配置。 Set the transport configuration. |
public Builder compressionConfig(CompressionConfig config) | 设置压缩配置。 Set the compression configuration. |
public Builder client(OkHttpClient client) | 设置客户端。 Use an existing OkHttpClient instance. |
public Builder enableGzipCompression() | 启用该配置。 Enable GZIP compression. |
public CompressingOkHttpTransport build() | 构建CompressingOkHttpTransport。 Build the CompressingOkHttpTransport. |
方法详情Method Detail
transportConfig
public Builder transportConfig(HttpTransportConfig config)
设置传输层配置。
Set the transport configuration.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
config | HttpTransportConfig | 配置。the configuration |
Builder返回当前实例,以支持链式调用。this builder
源码Source
io/agentscope/examples/compression/extra/CompressingOkHttpTransport.java:446–449compressionConfig
public Builder compressionConfig(CompressionConfig config)
设置压缩配置。
Set the compression configuration.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
config | CompressionConfig | 压缩配置。the compression configuration |
Builder返回当前实例,以支持链式调用。this builder
源码Source
io/agentscope/examples/compression/extra/CompressingOkHttpTransport.java:457–460client
public Builder client(OkHttpClient client)
设置客户端。
Use an existing OkHttpClient instance.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
client | OkHttpClient | 客户端(类型 `OkHttpClient`)。the existing OkHttpClient |
Builder返回当前实例,以支持链式调用。this builder
源码Source
io/agentscope/examples/compression/extra/CompressingOkHttpTransport.java:468–471enableGzipCompression
public Builder enableGzipCompression()
启用该配置。
Enable GZIP compression.
Builder返回当前实例,以支持链式调用。this builder
源码Source
io/agentscope/examples/compression/extra/CompressingOkHttpTransport.java:481–484build
public CompressingOkHttpTransport build()
构建CompressingOkHttpTransport。
Build the CompressingOkHttpTransport.
CompressingOkHttpTransport一种新的CompressingOkHttpTransport 实例。a new CompressingOkHttpTransport instance
源码Source
io/agentscope/examples/compression/extra/CompressingOkHttpTransport.java:491–497