Package com.configcat
Class ConfigCatClient.Options
- java.lang.Object
-
- com.configcat.ConfigCatClient.Options
-
- Enclosing class:
- ConfigCatClient
public static class ConfigCatClient.Options extends java.lang.ObjectOptions for configuringConfigCatClientinstance.
-
-
Constructor Summary
Constructors Constructor Description Options()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidbaseUrl(java.lang.String baseUrl)Sets the base ConfigCat CDN url.voidcache(ConfigCache cache)Sets the internal cache implementation.voiddataGovernance(DataGovernance dataGovernance)Default: Global.voiddefaultUser(User defaultUser)Sets the default user.voidflagOverrides(OverrideDataSourceBuilder dataSourceBuilder, OverrideBehaviour behaviour)Sets feature flag and setting overrides.ConfigCatHookshooks()Set the client hooks.voidhttpClient(okhttp3.OkHttpClient httpClient)Sets the underlying http client which will be used to fetch the latest configuration.voidlogLevel(LogLevel logLevel)Default: Warning.voidoffline(boolean offline)Set client offline mode.voidpollingMode(PollingMode pollingMode)Sets the internal refresh policy implementation.
-
-
-
Method Detail
-
httpClient
public void httpClient(okhttp3.OkHttpClient httpClient)
Sets the underlying http client which will be used to fetch the latest configuration.- Parameters:
httpClient- the http client.
-
cache
public void cache(ConfigCache cache)
Sets the internal cache implementation.- Parameters:
cache- aConfigCacheimplementation used to cache the configuration.
-
baseUrl
public void baseUrl(java.lang.String baseUrl)
Sets the base ConfigCat CDN url.- Parameters:
baseUrl- the base ConfigCat CDN url.
-
pollingMode
public void pollingMode(PollingMode pollingMode)
Sets the internal refresh policy implementation.- Parameters:
pollingMode- the polling mode.
-
dataGovernance
public void dataGovernance(DataGovernance dataGovernance)
Default: Global. Set this parameter to be in sync with the Data Governance preference on the Dashboard: Link (Only Organization Admins have access)- Parameters:
dataGovernance- theDataGovernanceparameter.
-
logLevel
public void logLevel(LogLevel logLevel)
Default: Warning. Sets the internal log level.- Parameters:
logLevel- theLogLevelparameter.
-
flagOverrides
public void flagOverrides(OverrideDataSourceBuilder dataSourceBuilder, OverrideBehaviour behaviour)
Sets feature flag and setting overrides.- Parameters:
dataSourceBuilder- builder that describes the overrides' data source.behaviour- the override behaviour. It can be used to set preference on whether the local values should override the remote values, or use local values only when a remote value doesn't exist, or use it for local only mode.- Throws:
java.lang.IllegalArgumentException- when the dataSourceBuilder or behaviour parameter is null.
-
defaultUser
public void defaultUser(User defaultUser)
Sets the default user.- Parameters:
defaultUser- the default user.
-
offline
public void offline(boolean offline)
Set client offline mode.- Parameters:
offline- the client offline mode value.
-
hooks
public ConfigCatHooks hooks()
Set the client hooks.- Returns:
- the hooks.
-
-