Class FlagsmithConfig.Builder

java.lang.Object
com.flagsmith.config.FlagsmithConfig.Builder
Enclosing class:
FlagsmithConfig

public static class FlagsmithConfig.Builder extends Object
  • Method Details

    • baseUri

      public FlagsmithConfig.Builder baseUri(String baseUri)
      Set the base URL for Flagsmith API, overriding default one.
      Parameters:
      baseUri - the new base URI for the API.
      Returns:
      the Builder
    • connectTimeout

      public FlagsmithConfig.Builder connectTimeout(int connectTimeoutMillis)
      Override default connection timeout for client connection.
      Parameters:
      connectTimeoutMillis - the connect timeout in milliseconds
      Returns:
      the Builder
    • writeTimeout

      public FlagsmithConfig.Builder writeTimeout(int writeTimeoutMillis)
      Override default write timeout for client connection.
      Parameters:
      writeTimeoutMillis - the write timeout in milliseconds
      Returns:
      the Builder
    • readTimeout

      public FlagsmithConfig.Builder readTimeout(int readTimeoutMillis)
      Override default read timeout for client connection.
      Parameters:
      readTimeoutMillis - the read timeout in milliseconds
      Returns:
      the Builder
    • sslSocketFactory

      public FlagsmithConfig.Builder sslSocketFactory(SSLSocketFactory sslSocketFactory, X509TrustManager trustManager)
      Added custom SSL certificate.
      Parameters:
      sslSocketFactory - SSL factory
      trustManager - X509TrustManager trust manager
      Returns:
      the Builder
    • addHttpInterceptor

      public FlagsmithConfig.Builder addHttpInterceptor(okhttp3.Interceptor interceptor)
      Add a custom HTTP interceptor.
      Parameters:
      interceptor - the HTTP interceptor
      Returns:
      the Builder
    • withProxy

      public FlagsmithConfig.Builder withProxy(Proxy proxy)
      Add a Proxy to the HttpClient.
      Parameters:
      proxy - the proxy
      Returns:
      the Builder
    • connectionPool

      public FlagsmithConfig.Builder connectionPool(okhttp3.ConnectionPool connectionPool)
      Provide a custom OkHttp ConnectionPool to tune keep-alive duration and maximum idle connections. When not set, OkHttp's defaults are used.
      Parameters:
      connectionPool - the ConnectionPool to use for the HTTP client
      Returns:
      the Builder
    • retries

      public FlagsmithConfig.Builder retries(Retry retries)
      Add retries for HTTP request to the builder.
      Parameters:
      retries - no of retries for requests
    • withLocalEvaluation

      public FlagsmithConfig.Builder withLocalEvaluation(Boolean localEvaluation)
      Local evaluation config.
      Parameters:
      localEvaluation - boolean to enable
    • withEnvironmentRefreshIntervalSeconds

      public FlagsmithConfig.Builder withEnvironmentRefreshIntervalSeconds(Integer seconds)
      set environment refresh rate with polling manager. Only needed when local evaluation is true.
      Parameters:
      seconds - seconds
    • withAnalyticsProcessor

      public FlagsmithConfig.Builder withAnalyticsProcessor(AnalyticsProcessor processor)
      Set the analytics processor.
      Parameters:
      processor - analytics processor object
    • withEnableAnalytics

      public FlagsmithConfig.Builder withEnableAnalytics(Boolean enable)
      Enable Analytics Processor.
      Parameters:
      enable - boolean to enable
    • withOfflineMode

      public FlagsmithConfig.Builder withOfflineMode(Boolean offlineMode)
      Enable offline mode.
      Parameters:
      offlineMode - boolean to enable offline mode
    • withOfflineHandler

      public FlagsmithConfig.Builder withOfflineHandler(IOfflineHandler offlineHandler)
      Set the offline handler (used as a fallback or with offlineMode).
      Parameters:
      offlineHandler - the offline handler
    • withSupportedProtocols

      public FlagsmithConfig.Builder withSupportedProtocols(List<FlagsmithConfig.Protocol> supportedProtocols)
      Specify the list of protocols supported for calls to the server.
      Parameters:
      supportedProtocols - the list of supported protocols
    • build

      public FlagsmithConfig build()