Class HttpClientFactory.Builder

java.lang.Object
cloud.opencode.base.oauth2.http.HttpClientFactory.Builder
Enclosing class:
HttpClientFactory

public static class HttpClientFactory.Builder extends Object
HTTP Client Builder HTTP 客户端构建器
Since:
JDK 25, opencode-base-oauth2 V1.0.0
Author:
Leon Soo www.LeonSoo.com
  • Constructor Details

    • Builder

      public Builder()
  • Method Details

    • connectTimeout

      public HttpClientFactory.Builder connectTimeout(Duration connectTimeout)
      Set the connection timeout 设置连接超时
      Parameters:
      connectTimeout - the connection timeout | 连接超时
      Returns:
      this builder | 此构建器
    • readTimeout

      public HttpClientFactory.Builder readTimeout(Duration readTimeout)
      Set the read timeout 设置读取超时
      Parameters:
      readTimeout - the read timeout | 读取超时
      Returns:
      this builder | 此构建器
    • connectTimeoutSeconds

      public HttpClientFactory.Builder connectTimeoutSeconds(long seconds)
      Set connection timeout in seconds 设置连接超时(秒)
      Parameters:
      seconds - the timeout in seconds | 超时时间(秒)
      Returns:
      this builder | 此构建器
    • readTimeoutSeconds

      public HttpClientFactory.Builder readTimeoutSeconds(long seconds)
      Set read timeout in seconds 设置读取超时(秒)
      Parameters:
      seconds - the timeout in seconds | 超时时间(秒)
      Returns:
      this builder | 此构建器
    • build

      public OAuth2HttpClient build()
      Build the HTTP client 构建 HTTP 客户端
      Returns:
      the HTTP client | HTTP 客户端