Package com.configcat

Class ConfigCatClient.Options

  • Enclosing class:
    ConfigCatClient

    public static class ConfigCatClient.Options
    extends java.lang.Object
    Options for configuring ConfigCatClient instance.
    • Constructor Detail

      • Options

        public Options()
    • 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 - a ConfigCache implementation 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: https://app.configcat.com/organization/data-governance (Only Organization Admins have access)
        Parameters:
        dataGovernance - the DataGovernance parameter.
      • logLevel

        public void logLevel​(LogLevel logLevel)
        Default: Warning. Sets the internal log level.
        Parameters:
        logLevel - the LogLevel parameter.
      • 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.