Class SpotifyHttpManager.Builder

java.lang.Object
se.michaelthelin.spotify.SpotifyHttpManager.Builder
Enclosing class:
SpotifyHttpManager

public static class SpotifyHttpManager.Builder extends Object
Builder class for creating SpotifyHttpManager instances. Provides a fluent interface for configuring HTTP client settings.
  • Constructor Details

    • Builder

      public Builder()
      Default constructor.
  • Method Details

    • setConnectionManager

      public SpotifyHttpManager.Builder setConnectionManager(org.apache.hc.client5.http.io.HttpClientConnectionManager connectionManager)
      Sets the HTTP client connection manager.
      Parameters:
      connectionManager - the connection manager to use
      Returns:
      this builder instance for method chaining
    • setProxy

      public SpotifyHttpManager.Builder setProxy(org.apache.hc.core5.http.HttpHost proxy)
      Sets the HTTP proxy configuration.
      Parameters:
      proxy - the HTTP proxy host
      Returns:
      this builder instance for method chaining
    • setProxyCredentials

      public SpotifyHttpManager.Builder setProxyCredentials(org.apache.hc.client5.http.auth.UsernamePasswordCredentials proxyCredentials)
      Sets the proxy authentication credentials.
      Parameters:
      proxyCredentials - the proxy credentials
      Returns:
      this builder instance for method chaining
    • setCacheMaxEntries

      public SpotifyHttpManager.Builder setCacheMaxEntries(Integer cacheMaxEntries)
      Sets the maximum number of cache entries.
      Parameters:
      cacheMaxEntries - the maximum cache entries
      Returns:
      this builder instance for method chaining
    • setCacheMaxObjectSize

      public SpotifyHttpManager.Builder setCacheMaxObjectSize(Integer cacheMaxObjectSize)
      Sets the maximum size of cached objects.
      Parameters:
      cacheMaxObjectSize - the maximum cache object size
      Returns:
      this builder instance for method chaining
    • setCacheShared

      public SpotifyHttpManager.Builder setCacheShared(Boolean cacheShared)
      Sets whether the cache is shared between multiple HTTP clients.
      Parameters:
      cacheShared - true if the cache should be shared, false otherwise
      Returns:
      this builder instance for method chaining
    • setConnectionRequestTimeout

      public SpotifyHttpManager.Builder setConnectionRequestTimeout(Integer connectionRequestTimeout)
      Sets the connection request timeout in milliseconds.
      Parameters:
      connectionRequestTimeout - the connection request timeout
      Returns:
      this builder instance for method chaining
    • setSocketTimeout

      public SpotifyHttpManager.Builder setSocketTimeout(Integer socketTimeout)
      Sets the socket timeout in milliseconds.
      Parameters:
      socketTimeout - the socket timeout
      Returns:
      this builder instance for method chaining
    • build

      public SpotifyHttpManager build()
      Builds a new SpotifyHttpManager instance with the configured settings.
      Returns:
      a new SpotifyHttpManager instance