Package com.flagsmith.config
Class FlagsmithConfig.Builder
java.lang.Object
com.flagsmith.config.FlagsmithConfig.Builder
- Enclosing class:
- FlagsmithConfig
public static class FlagsmithConfig.Builder extends Object
-
Method Summary
Modifier and Type Method Description FlagsmithConfig.BuilderaddHttpInterceptor(okhttp3.Interceptor interceptor)Add a custom HTTP interceptor.FlagsmithConfig.BuilderbaseUri(String baseUri)Set the base URL for Flagsmith API, overriding default one.FlagsmithConfigbuild()FlagsmithConfig.BuilderconnectTimeout(int connectTimeoutMillis)Override default connection timeout for client connection.FlagsmithConfig.BuilderreadTimeout(int readTimeoutMillis)Override default read timeout for client connection.FlagsmithConfig.Builderretries(Retry retries)Add retries for HTTP request to the builder.FlagsmithConfig.BuildersslSocketFactory(SSLSocketFactory sslSocketFactory, X509TrustManager trustManager)Added custom SSL certificate.FlagsmithConfig.BuilderwithAnalyticsProcessor(AnalyticsProcessor processor)Set the analytics processor.FlagsmithConfig.BuilderwithEnableAnalytics(Boolean enable)Enable Analytics Processor.FlagsmithConfig.BuilderwithEnvironmentRefreshIntervalSeconds(Integer seconds)set environment refresh rate with polling manager.FlagsmithConfig.BuilderwithLocalEvaluation(Boolean localEvaluation)Local evaluation config.FlagsmithConfig.BuilderwithOfflineHandler(IOfflineHandler offlineHandler)Set the offline handler (used as a fallback or with offlineMode).FlagsmithConfig.BuilderwithOfflineMode(Boolean offlineMode)Enable offline mode.FlagsmithConfig.BuilderwithProxy(Proxy proxy)Add a Proxy to the HttpClient.FlagsmithConfig.BuilderwithSupportedProtocols(List<com.flagsmith.config.FlagsmithConfig.Protocol> supportedProtocols)Specify the list of protocols supported for calls to the server.FlagsmithConfig.BuilderwriteTimeout(int writeTimeoutMillis)Override default write timeout for client connection.
-
Method Details
-
baseUri
Set the base URL for Flagsmith API, overriding default one.- Parameters:
baseUri- the new base URI for the API.- Returns:
- the Builder
-
connectTimeout
Override default connection timeout for client connection.- Parameters:
connectTimeoutMillis- the connect timeout in milliseconds- Returns:
- the Builder
-
writeTimeout
Override default write timeout for client connection.- Parameters:
writeTimeoutMillis- the write timeout in milliseconds- Returns:
- the Builder
-
readTimeout
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 factorytrustManager- X509TrustManager trust manager- Returns:
- the Builder
-
addHttpInterceptor
Add a custom HTTP interceptor.- Parameters:
interceptor- the HTTP interceptor- Returns:
- the Builder
-
withProxy
Add a Proxy to the HttpClient.- Parameters:
proxy- the proxy- Returns:
- the Builder
-
retries
Add retries for HTTP request to the builder.- Parameters:
retries- no of retries for requests
-
withLocalEvaluation
Local evaluation config.- Parameters:
localEvaluation- boolean to enable
-
withEnvironmentRefreshIntervalSeconds
set environment refresh rate with polling manager. Only needed when local evaluation is true.- Parameters:
seconds- seconds
-
withAnalyticsProcessor
Set the analytics processor.- Parameters:
processor- analytics processor object
-
withEnableAnalytics
Enable Analytics Processor.- Parameters:
enable- boolean to enable
-
withOfflineMode
Enable offline mode.- Parameters:
offlineMode- boolean to enable offline mode
-
withOfflineHandler
Set the offline handler (used as a fallback or with offlineMode).- Parameters:
offlineHandler- the offline handler
-
withSupportedProtocols
public FlagsmithConfig.Builder withSupportedProtocols(List<com.flagsmith.config.FlagsmithConfig.Protocol> supportedProtocols)Specify the list of protocols supported for calls to the server.- Parameters:
supportedProtocols- the list of supported protocols
-
build
-