Class Options
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionOptions(Boolean enabled, Boolean isQaMode, Boolean isCacheDisabled, Boolean allowUrlOverrides, String url, String apiHost, String clientKey, String decryptionKey, List<String> stickyBucketIdentifierAttributes, StickyBucketService stickyBucketService, TrackingCallbackWithUser trackingCallBackWithUser, FeatureUsageCallbackWithUser featureUsageCallbackWithUser, FeatureRefreshStrategy refreshStrategy, Integer swrTtlSeconds, FeatureRefreshCallback featureRefreshCallback, com.google.gson.JsonObject globalAttributes, Map<String, Object> globalForcedFeatureValues, Map<String, ?> globalForcedVariationsMap, GbCacheManager cacheManager, CacheMode cacheMode, String cacheDirectory, Boolean remoteEval, List<String> cacheKeyAttributes, Integer remoteEvalCacheSize, Integer remoteEvalCacheTtlSeconds, Duration backgroundFetchInterval, FeatureFetchRetryPolicy retryPolicy, Boolean sseReconnectOnFailure, List<GrowthBookPlugin> plugins) Backward-compatible constructor matching the positional signature onmainbeforefeatureRefreshListenerExecutorwas introduced.Options(Boolean enabled, Boolean isQaMode, Boolean isCacheDisabled, Boolean allowUrlOverrides, String url, String apiHost, String clientKey, String decryptionKey, List<String> stickyBucketIdentifierAttributes, StickyBucketService stickyBucketService, TrackingCallbackWithUser trackingCallBackWithUser, FeatureUsageCallbackWithUser featureUsageCallbackWithUser, FeatureRefreshStrategy refreshStrategy, Integer swrTtlSeconds, FeatureRefreshCallback featureRefreshCallback, com.google.gson.JsonObject globalAttributes, Map<String, Object> globalForcedFeatureValues, Map<String, ?> globalForcedVariationsMap, GbCacheManager cacheManager, CacheMode cacheMode, String cacheDirectory, Boolean remoteEval, List<String> cacheKeyAttributes, Integer remoteEvalCacheSize, Integer remoteEvalCacheTtlSeconds, Duration backgroundFetchInterval, FeatureFetchRetryPolicy retryPolicy, Executor featureRefreshListenerExecutor, Boolean sseReconnectOnFailure, List<GrowthBookPlugin> plugins) Full positional signature onmainbefore the async sticky-bucket options were introduced.Options(Boolean enabled, Boolean isQaMode, Boolean isCacheDisabled, Boolean allowUrlOverrides, String url, String apiHost, String clientKey, String decryptionKey, List<String> stickyBucketIdentifierAttributes, StickyBucketService stickyBucketService, TrackingCallbackWithUser trackingCallBackWithUser, FeatureUsageCallbackWithUser featureUsageCallbackWithUser, FeatureRefreshStrategy refreshStrategy, Integer swrTtlSeconds, FeatureRefreshCallback featureRefreshCallback, com.google.gson.JsonObject globalAttributes, Map<String, Object> globalForcedFeatureValues, Map<String, ?> globalForcedVariationsMap, GbCacheManager cacheManager, CacheMode cacheMode, String cacheDirectory, Boolean remoteEval, List<String> cacheKeyAttributes, Integer remoteEvalCacheSize, Integer remoteEvalCacheTtlSeconds, Duration backgroundFetchInterval, FeatureFetchRetryPolicy retryPolicy, Executor featureRefreshListenerExecutor, Boolean sseReconnectOnFailure, List<GrowthBookPlugin> plugins, AsyncStickyBucketService asyncStickyBucketService, Executor asyncExecutor, Long stickyBucketCacheTtlSeconds, Integer stickyBucketCacheSize, Duration stickyBucketTimeout) Options(Boolean enabled, Boolean isQaMode, Boolean isCacheDisabled, Boolean allowUrlOverrides, String url, String apiHost, String clientKey, String decryptionKey, List<String> stickyBucketIdentifierAttributes, StickyBucketService stickyBucketService, TrackingCallbackWithUser trackingCallBackWithUser, FeatureUsageCallbackWithUser featureUsageCallbackWithUser, FeatureRefreshStrategy refreshStrategy, Integer swrTtlSeconds, FeatureRefreshCallback featureRefreshCallback, com.google.gson.JsonObject globalAttributes, Map<String, Object> globalForcedFeatureValues, Map<String, ?> globalForcedVariationsMap, GbCacheManager cacheManager, CacheMode cacheMode, String cacheDirectory, Boolean remoteEval, List<String> cacheKeyAttributes, Integer remoteEvalCacheSize, Integer remoteEvalCacheTtlSeconds, Duration backgroundFetchInterval, FeatureFetchRetryPolicy retryPolicy, List<GrowthBookPlugin> plugins) Backward-compatible constructor matchingmain's 0.11.x positional signature, beforefeatureRefreshListenerExecutorandsseReconnectOnFailurewere introduced.Options(Boolean enabled, Boolean isQaMode, Boolean isCacheDisabled, Boolean allowUrlOverrides, String url, String apiHost, String clientKey, String decryptionKey, List<String> stickyBucketIdentifierAttributes, StickyBucketService stickyBucketService, TrackingCallbackWithUser trackingCallBackWithUser, FeatureUsageCallbackWithUser featureUsageCallbackWithUser, FeatureRefreshStrategy refreshStrategy, Integer swrTtlSeconds, FeatureRefreshCallback featureRefreshCallback, com.google.gson.JsonObject globalAttributes, Map<String, Object> globalForcedFeatureValues, Map<String, ?> globalForcedVariationsMap, GbCacheManager cacheManager, CacheMode cacheMode, String cacheDirectory, Boolean remoteEval, List<String> cacheKeyAttributes, Integer remoteEvalCacheSize, Integer remoteEvalCacheTtlSeconds, Duration backgroundFetchInterval, FeatureFetchRetryPolicy retryPolicy, List<GrowthBookPlugin> plugins, AsyncStickyBucketService asyncStickyBucketService, Executor asyncExecutor, Long stickyBucketCacheTtlSeconds, Integer stickyBucketCacheSize) Backward-compatible constructor matching the 0.11.0 positional signature, beforefeatureRefreshListenerExecutorandsseReconnectOnFailurewere introduced.Options(Boolean enabled, Boolean isQaMode, Boolean isCacheDisabled, Boolean allowUrlOverrides, String url, String apiHost, String clientKey, String decryptionKey, List<String> stickyBucketIdentifierAttributes, StickyBucketService stickyBucketService, TrackingCallbackWithUser trackingCallBackWithUser, FeatureUsageCallbackWithUser featureUsageCallbackWithUser, FeatureRefreshStrategy refreshStrategy, Integer swrTtlSeconds, FeatureRefreshCallback featureRefreshCallback, com.google.gson.JsonObject globalAttributes, Map<String, Object> globalForcedFeatureValues, Map<String, Integer> globalForcedVariationsMap, GbCacheManager cacheManager, CacheMode cacheMode, String cacheDirectory) -
Method Summary
Modifier and TypeMethodDescriptionstatic Options.OptionsBuilderbuilder()booleanBoolean flag to allow URL overrides (default: false)Executor for the client's asynchronous entry points: offloading blockingStickyBucketServicecalls and composing async evaluations.Non-blocking sticky bucket service for the multi-user client.String format of user attributes that are used to assign variationsOptional minimum interval between non-forced background feature refreshes.Optional decryption Key.Whether globally all experiments are enabled (default: true) Switch to globally disable all experiments.Deprecated.Optional executor for client-level feature refresh listeners.A function that takesStringandFeatureResultas arguments.com.google.gson.JsonObjectMap of user attributes that are used to assign variationsManual force feature valuesForce specific experiments to always assign a specific variation (used for QA)If true, random assignment is disabled and only explicitly forced variations are used.Plugins registered with the GrowthBook client.Strategy for building urlHard expiry (seconds) for cached remote-eval responses;nulldisables time-based expiry.Optional bounded retry policy.Whether the multi-user client reconnects the SSE stream after an abnormal failure or a server close.Maximum entries in the opt-in sticky bucket read cache (default 1000).Opt-in TTL, in seconds, for caching sticky bucket reads per user attributes.Attribute keys whose sticky bucket documents are read for every user, in addition to the attributes the loaded features' experiments hash on (those are always read).The standard cache TTL to use.A function that takesExperimentandExperimentResultas arguments.getUrl()inthashCode()booleanbooleanbooleanWhether either flavor of sticky bucket service is configured.voidsetAllowUrlOverrides(Boolean allowUrlOverrides) Boolean flag to allow URL overrides (default: false)voidsetApiHost(String apiHost) voidsetAsyncExecutor(Executor asyncExecutor) Executor for the client's asynchronous entry points: offloading blockingStickyBucketServicecalls and composing async evaluations.voidsetAsyncStickyBucketService(AsyncStickyBucketService asyncStickyBucketService) Non-blocking sticky bucket service for the multi-user client.voidsetAttributesJson(String attributesJson) String format of user attributes that are used to assign variationsvoidsetBackgroundFetchInterval(Duration backgroundFetchInterval) Optional minimum interval between non-forced background feature refreshes.voidsetCacheDirectory(String cacheDirectory) voidsetCacheKeyAttributes(List<String> cacheKeyAttributes) voidsetCacheManager(GbCacheManager cacheManager) voidsetCacheMode(CacheMode cacheMode) voidsetClientKey(String clientKey) voidsetDecryptionKey(String decryptionKey) Optional decryption Key.voidsetEnabled(Boolean enabled) Whether globally all experiments are enabled (default: true) Switch to globally disable all experiments.voidsetFeatureRefreshCallback(FeatureRefreshCallback featureRefreshCallback) Deprecated.UseGrowthBookClient.addFeatureRefreshListener(...)orGrowthBookClient.subscribeFeatureRefreshListener(...)after constructing the client.voidsetFeatureRefreshListenerExecutor(Executor featureRefreshListenerExecutor) Optional executor for client-level feature refresh listeners.voidsetFeatureUsageCallbackWithUser(FeatureUsageCallbackWithUser featureUsageCallbackWithUser) A function that takesStringandFeatureResultas arguments.voidsetGlobalAttributes(String attributesJson) voidsetGlobalForcedFeatureValues(Map<String, Object> globalForcedFeatureValues) Manual force feature valuesvoidsetGlobalForcedVariationsMap(Map<String, ?> globalForcedVariationsMap) voidvoidsetIsCacheDisabled(Boolean isCacheDisabled) voidsetIsQaMode(Boolean isQaMode) If true, random assignment is disabled and only explicitly forced variations are used.voidsetPlugins(List<GrowthBookPlugin> plugins) Plugins registered with the GrowthBook client.voidsetRefreshStrategy(FeatureRefreshStrategy refreshStrategy) Strategy for building urlvoidsetRemoteEval(Boolean remoteEval) voidsetRemoteEvalCacheSize(Integer remoteEvalCacheSize) voidsetRemoteEvalCacheTtlSeconds(Integer remoteEvalCacheTtlSeconds) Hard expiry (seconds) for cached remote-eval responses;nulldisables time-based expiry.voidsetRetryPolicy(FeatureFetchRetryPolicy retryPolicy) Optional bounded retry policy.voidsetSseReconnectOnFailure(Boolean sseReconnectOnFailure) Whether the multi-user client reconnects the SSE stream after an abnormal failure or a server close.voidsetStickyBucketCacheSize(Integer stickyBucketCacheSize) Maximum entries in the opt-in sticky bucket read cache (default 1000).voidsetStickyBucketCacheTtlSeconds(Long stickyBucketCacheTtlSeconds) Opt-in TTL, in seconds, for caching sticky bucket reads per user attributes.voidsetStickyBucketIdentifierAttributes(List<String> stickyBucketIdentifierAttributes) Attribute keys whose sticky bucket documents are read for every user, in addition to the attributes the loaded features' experiments hash on (those are always read).voidsetStickyBucketService(StickyBucketService stickyBucketService) Service that provide functionality of Sticky BucketingvoidsetStickyBucketTimeout(Duration stickyBucketTimeout) How long the multi-user client waits for one sticky bucket store call, read or save (defaultDEFAULT_STICKY_BUCKET_TIMEOUT, 5 seconds).voidsetSwrTtlSeconds(Integer swrTtlSeconds) The standard cache TTL to use.voidsetTrackingCallBackWithUser(TrackingCallbackWithUser trackingCallBackWithUser) A function that takesExperimentandExperimentResultas arguments.voidtoString()
-
Field Details
-
DEFAULT_STICKY_BUCKET_TIMEOUT
Default forstickyBucketTimeout.
-
-
Constructor Details
-
Options
public Options(@Nullable Boolean enabled, Boolean isQaMode, @Nullable Boolean isCacheDisabled, Boolean allowUrlOverrides, @Nullable String url, @Nullable String apiHost, @Nullable String clientKey, @Nullable String decryptionKey, @Nullable List<String> stickyBucketIdentifierAttributes, @Nullable StickyBucketService stickyBucketService, @Nullable TrackingCallbackWithUser trackingCallBackWithUser, @Nullable FeatureUsageCallbackWithUser featureUsageCallbackWithUser, @Nullable FeatureRefreshStrategy refreshStrategy, @Nullable Integer swrTtlSeconds, @Deprecated @Nullable FeatureRefreshCallback featureRefreshCallback, @Nullable com.google.gson.JsonObject globalAttributes, @Nullable Map<String, Object> globalForcedFeatureValues, @Nullable Map<String, Integer> globalForcedVariationsMap, @Nullable GbCacheManager cacheManager, @Nullable CacheMode cacheMode, @Nullable String cacheDirectory) -
Options
public Options(@Nullable Boolean enabled, Boolean isQaMode, @Nullable Boolean isCacheDisabled, Boolean allowUrlOverrides, @Nullable String url, @Nullable String apiHost, @Nullable String clientKey, @Nullable String decryptionKey, @Nullable List<String> stickyBucketIdentifierAttributes, @Nullable StickyBucketService stickyBucketService, @Nullable TrackingCallbackWithUser trackingCallBackWithUser, @Nullable FeatureUsageCallbackWithUser featureUsageCallbackWithUser, @Nullable FeatureRefreshStrategy refreshStrategy, @Nullable Integer swrTtlSeconds, @Nullable FeatureRefreshCallback featureRefreshCallback, @Nullable com.google.gson.JsonObject globalAttributes, @Nullable Map<String, Object> globalForcedFeatureValues, @Nullable Map<String, ?> globalForcedVariationsMap, @Nullable GbCacheManager cacheManager, @Nullable CacheMode cacheMode, @Nullable String cacheDirectory, @Nullable Boolean remoteEval, @Nullable List<String> cacheKeyAttributes, @Nullable Integer remoteEvalCacheSize, @Nullable Integer remoteEvalCacheTtlSeconds, @Nullable Duration backgroundFetchInterval, @Nullable FeatureFetchRetryPolicy retryPolicy, @Nullable List<GrowthBookPlugin> plugins, @Nullable AsyncStickyBucketService asyncStickyBucketService, @Nullable Executor asyncExecutor, @Nullable Long stickyBucketCacheTtlSeconds, @Nullable Integer stickyBucketCacheSize) Backward-compatible constructor matching the 0.11.0 positional signature, beforefeatureRefreshListenerExecutorandsseReconnectOnFailurewere introduced. -
Options
public Options(@Nullable Boolean enabled, Boolean isQaMode, @Nullable Boolean isCacheDisabled, Boolean allowUrlOverrides, @Nullable String url, @Nullable String apiHost, @Nullable String clientKey, @Nullable String decryptionKey, @Nullable List<String> stickyBucketIdentifierAttributes, @Nullable StickyBucketService stickyBucketService, @Nullable TrackingCallbackWithUser trackingCallBackWithUser, @Nullable FeatureUsageCallbackWithUser featureUsageCallbackWithUser, @Nullable FeatureRefreshStrategy refreshStrategy, @Nullable Integer swrTtlSeconds, @Deprecated @Nullable FeatureRefreshCallback featureRefreshCallback, @Nullable com.google.gson.JsonObject globalAttributes, @Nullable Map<String, Object> globalForcedFeatureValues, @Nullable Map<String, ?> globalForcedVariationsMap, @Nullable GbCacheManager cacheManager, @Nullable CacheMode cacheMode, @Nullable String cacheDirectory, @Nullable Boolean remoteEval, @Nullable List<String> cacheKeyAttributes, @Nullable Integer remoteEvalCacheSize, @Nullable Integer remoteEvalCacheTtlSeconds, @Nullable Duration backgroundFetchInterval, @Nullable FeatureFetchRetryPolicy retryPolicy, @Nullable Boolean sseReconnectOnFailure, @Nullable List<GrowthBookPlugin> plugins) Backward-compatible constructor matching the positional signature onmainbeforefeatureRefreshListenerExecutorwas introduced.That signature was added after the 0.11.0 release and never shipped, so this overload exists only so the branch does not narrow
main's surface for callers built against an unreleased snapshot. The released signatures are the 23- and 30-argument ones above. -
Options
public Options(@Nullable Boolean enabled, Boolean isQaMode, @Nullable Boolean isCacheDisabled, Boolean allowUrlOverrides, @Nullable String url, @Nullable String apiHost, @Nullable String clientKey, @Nullable String decryptionKey, @Nullable List<String> stickyBucketIdentifierAttributes, @Nullable StickyBucketService stickyBucketService, @Nullable TrackingCallbackWithUser trackingCallBackWithUser, @Nullable FeatureUsageCallbackWithUser featureUsageCallbackWithUser, @Nullable FeatureRefreshStrategy refreshStrategy, @Nullable Integer swrTtlSeconds, @Nullable FeatureRefreshCallback featureRefreshCallback, @Nullable com.google.gson.JsonObject globalAttributes, @Nullable Map<String, Object> globalForcedFeatureValues, @Nullable Map<String, ?> globalForcedVariationsMap, @Nullable GbCacheManager cacheManager, @Nullable CacheMode cacheMode, @Nullable String cacheDirectory, @Nullable Boolean remoteEval, @Nullable List<String> cacheKeyAttributes, @Nullable Integer remoteEvalCacheSize, @Nullable Integer remoteEvalCacheTtlSeconds, @Nullable Duration backgroundFetchInterval, @Nullable FeatureFetchRetryPolicy retryPolicy, @Nullable List<GrowthBookPlugin> plugins) Backward-compatible constructor matchingmain's 0.11.x positional signature, beforefeatureRefreshListenerExecutorandsseReconnectOnFailurewere introduced. -
Options
public Options(@Nullable Boolean enabled, Boolean isQaMode, @Nullable Boolean isCacheDisabled, Boolean allowUrlOverrides, @Nullable String url, @Nullable String apiHost, @Nullable String clientKey, @Nullable String decryptionKey, @Nullable List<String> stickyBucketIdentifierAttributes, @Nullable StickyBucketService stickyBucketService, @Nullable TrackingCallbackWithUser trackingCallBackWithUser, @Nullable FeatureUsageCallbackWithUser featureUsageCallbackWithUser, @Nullable FeatureRefreshStrategy refreshStrategy, @Nullable Integer swrTtlSeconds, @Nullable FeatureRefreshCallback featureRefreshCallback, @Nullable com.google.gson.JsonObject globalAttributes, @Nullable Map<String, Object> globalForcedFeatureValues, @Nullable Map<String, ?> globalForcedVariationsMap, @Nullable GbCacheManager cacheManager, @Nullable CacheMode cacheMode, @Nullable String cacheDirectory, @Nullable Boolean remoteEval, @Nullable List<String> cacheKeyAttributes, @Nullable Integer remoteEvalCacheSize, @Nullable Integer remoteEvalCacheTtlSeconds, @Nullable Duration backgroundFetchInterval, @Nullable FeatureFetchRetryPolicy retryPolicy, @Nullable Executor featureRefreshListenerExecutor, @Nullable Boolean sseReconnectOnFailure, @Nullable List<GrowthBookPlugin> plugins) Full positional signature onmainbefore the async sticky-bucket options were introduced. Kept as a delegating overload so the published 30-argument arity is preserved. -
Options
public Options(@Nullable Boolean enabled, Boolean isQaMode, @Nullable Boolean isCacheDisabled, Boolean allowUrlOverrides, @Nullable String url, @Nullable String apiHost, @Nullable String clientKey, @Nullable String decryptionKey, @Nullable List<String> stickyBucketIdentifierAttributes, @Nullable StickyBucketService stickyBucketService, @Nullable TrackingCallbackWithUser trackingCallBackWithUser, @Nullable FeatureUsageCallbackWithUser featureUsageCallbackWithUser, @Nullable FeatureRefreshStrategy refreshStrategy, @Nullable Integer swrTtlSeconds, @Deprecated @Nullable FeatureRefreshCallback featureRefreshCallback, @Nullable com.google.gson.JsonObject globalAttributes, @Nullable Map<String, Object> globalForcedFeatureValues, @Nullable Map<String, ?> globalForcedVariationsMap, @Nullable GbCacheManager cacheManager, @Nullable CacheMode cacheMode, @Nullable String cacheDirectory, @Nullable Boolean remoteEval, @Nullable List<String> cacheKeyAttributes, @Nullable Integer remoteEvalCacheSize, @Nullable Integer remoteEvalCacheTtlSeconds, @Nullable Duration backgroundFetchInterval, @Nullable FeatureFetchRetryPolicy retryPolicy, @Nullable Executor featureRefreshListenerExecutor, @Nullable Boolean sseReconnectOnFailure, @Nullable List<GrowthBookPlugin> plugins, @Nullable AsyncStickyBucketService asyncStickyBucketService, @Nullable Executor asyncExecutor, @Nullable Long stickyBucketCacheTtlSeconds, @Nullable Integer stickyBucketCacheSize, @Nullable Duration stickyBucketTimeout)
-
-
Method Details
-
setGlobalForcedVariationsMap
-
getRefreshingStrategy
-
getCacheMode
-
getCacheDirectory
-
getStickyBucketTimeout
-
isSseReconnectOnFailure
public boolean isSseReconnectOnFailure() -
getStickyBucketService
-
setInMemoryStickyBucketService
public void setInMemoryStickyBucketService() -
isStickyBucketingConfigured
public boolean isStickyBucketingConfigured()Whether either flavor of sticky bucket service is configured.- Returns:
- true when a sync or async sticky bucket service is set
-
setGlobalAttributes
-
isRemoteEvalEnabled
public boolean isRemoteEvalEnabled() -
builder
-
getEnabled
Whether globally all experiments are enabled (default: true) Switch to globally disable all experiments. -
getIsQaMode
If true, random assignment is disabled and only explicitly forced variations are used. -
getIsCacheDisabled
-
getAllowUrlOverrides
Boolean flag to allow URL overrides (default: false) -
getUrl
-
getApiHost
-
getClientKey
-
getDecryptionKey
Optional decryption Key. If this is not null, featuresJson should be an encrypted payload. -
getStickyBucketIdentifierAttributes
Attribute keys whose sticky bucket documents are read for every user, in addition to the attributes the loaded features' experiments hash on (those are always read). Needed only for attributes the SDK cannot derive, such as the hash attribute of an inline experiment. -
getTrackingCallBackWithUser
A function that takesExperimentandExperimentResultas arguments. -
getFeatureUsageCallbackWithUser
A function that takesStringandFeatureResultas arguments. A callback that will be invoked every time a feature is viewed. Listen for feature usage events -
getRefreshStrategy
Strategy for building url -
getSwrTtlSeconds
The standard cache TTL to use. -
getGlobalAttributes
@Nullable public com.google.gson.JsonObject getGlobalAttributes()Map of user attributes that are used to assign variations -
getAttributesJson
String format of user attributes that are used to assign variations -
getGlobalForcedFeatureValues
Manual force feature values -
getGlobalForcedVariationsMap
Force specific experiments to always assign a specific variation (used for QA) -
getFeatureRefreshCallback
Deprecated.UseGrowthBookClient.addFeatureRefreshListener(...)orGrowthBookClient.subscribeFeatureRefreshListener(...)after constructing the client.Legacy feature refresh callback. -
getCacheManager
-
getFeatureRefreshListenerExecutor
Optional executor for client-level feature refresh listeners. When not supplied, the client dispatches listener callbacks on a dedicated daemon thread it owns and shuts down. -
getPlugins
Plugins registered with the GrowthBook client. SeeGrowthBookPluginandGrowthBookTrackingPlugin. The owning client builds a per-instancePluginRegistryfrom this list; the registry itself is carried onEvaluationContext, not here, so reusing oneOptionsacross clients stays isolated. -
getBackgroundFetchInterval
Optional minimum interval between non-forced background feature refreshes. -
getRetryPolicy
Optional bounded retry policy. Repositories use the default policy when null. -
getRemoteEval
-
getCacheKeyAttributes
-
getRemoteEvalCacheSize
-
getRemoteEvalCacheTtlSeconds
Hard expiry (seconds) for cached remote-eval responses;nulldisables time-based expiry. -
getSseReconnectOnFailure
Whether the multi-user client reconnects the SSE stream after an abnormal failure or a server close. Reconnect attempts are bounded byretryPolicy. Defaults totrue. -
getAsyncStickyBucketService
Non-blocking sticky bucket service for the multi-user client. Mutually exclusive withstickyBucketService— configure exactly one. SeeAsyncStickyBucketServicefor the contract.A failed read from either kind of service is logged and that evaluation continues with normal bucketing, but none of its assignments are saved: a variation bucketed without the stored assignment must not replace it.
-
getAsyncExecutor
Executor for the client's asynchronous entry points: offloading blockingStickyBucketServicecalls and composing async evaluations. The synchronous evaluation API never uses it; it calls a blocking service on the calling thread. When null, the client creates its own bounded daemon pool and shuts it down inshutdown(); a caller-supplied executor is never shut down by the SDK. On JDK 21+, passExecutors.newVirtualThreadPerTaskExecutor()so blocking offloads scale with the store instead of a fixed pool. -
getStickyBucketCacheTtlSeconds
Opt-in TTL, in seconds, for caching sticky bucket reads per user attributes. Null or non-positive (the default) disables caching: assignments are fetched per evaluation, so assignment changes made by other processes are picked up promptly. Enabling trades that freshness for fewer store lookups on hot users. -
getStickyBucketCacheSize
Maximum entries in the opt-in sticky bucket read cache (default 1000). Non-positive disables caching. Only meaningful whenstickyBucketCacheTtlSecondsis set. -
setEnabled
Whether globally all experiments are enabled (default: true) Switch to globally disable all experiments. -
setIsQaMode
If true, random assignment is disabled and only explicitly forced variations are used. -
setIsCacheDisabled
-
setAllowUrlOverrides
Boolean flag to allow URL overrides (default: false) -
setUrl
-
setApiHost
-
setClientKey
-
setDecryptionKey
Optional decryption Key. If this is not null, featuresJson should be an encrypted payload. -
setStickyBucketIdentifierAttributes
public void setStickyBucketIdentifierAttributes(@Nullable List<String> stickyBucketIdentifierAttributes) Attribute keys whose sticky bucket documents are read for every user, in addition to the attributes the loaded features' experiments hash on (those are always read). Needed only for attributes the SDK cannot derive, such as the hash attribute of an inline experiment. -
setStickyBucketService
Service that provide functionality of Sticky Bucketing -
setTrackingCallBackWithUser
public void setTrackingCallBackWithUser(@Nullable TrackingCallbackWithUser trackingCallBackWithUser) A function that takesExperimentandExperimentResultas arguments. -
setFeatureUsageCallbackWithUser
public void setFeatureUsageCallbackWithUser(@Nullable FeatureUsageCallbackWithUser featureUsageCallbackWithUser) A function that takesStringandFeatureResultas arguments. A callback that will be invoked every time a feature is viewed. Listen for feature usage events -
setRefreshStrategy
Strategy for building url -
setSwrTtlSeconds
The standard cache TTL to use. -
setAttributesJson
String format of user attributes that are used to assign variations -
setGlobalForcedFeatureValues
Manual force feature values -
setFeatureRefreshCallback
@Deprecated public void setFeatureRefreshCallback(@Nullable FeatureRefreshCallback featureRefreshCallback) Deprecated.UseGrowthBookClient.addFeatureRefreshListener(...)orGrowthBookClient.subscribeFeatureRefreshListener(...)after constructing the client.Legacy feature refresh callback. -
setCacheManager
-
setCacheMode
-
setCacheDirectory
-
setFeatureRefreshListenerExecutor
Optional executor for client-level feature refresh listeners. When not supplied, the client dispatches listener callbacks on a dedicated daemon thread it owns and shuts down. -
setPlugins
Plugins registered with the GrowthBook client. SeeGrowthBookPluginandGrowthBookTrackingPlugin. The owning client builds a per-instancePluginRegistryfrom this list; the registry itself is carried onEvaluationContext, not here, so reusing oneOptionsacross clients stays isolated. -
setBackgroundFetchInterval
Optional minimum interval between non-forced background feature refreshes. -
setRetryPolicy
Optional bounded retry policy. Repositories use the default policy when null. -
setRemoteEval
-
setCacheKeyAttributes
-
setRemoteEvalCacheSize
-
setRemoteEvalCacheTtlSeconds
Hard expiry (seconds) for cached remote-eval responses;nulldisables time-based expiry. -
setSseReconnectOnFailure
Whether the multi-user client reconnects the SSE stream after an abnormal failure or a server close. Reconnect attempts are bounded byretryPolicy. Defaults totrue. -
setAsyncStickyBucketService
public void setAsyncStickyBucketService(@Nullable AsyncStickyBucketService asyncStickyBucketService) Non-blocking sticky bucket service for the multi-user client. Mutually exclusive withstickyBucketService— configure exactly one. SeeAsyncStickyBucketServicefor the contract.A failed read from either kind of service is logged and that evaluation continues with normal bucketing, but none of its assignments are saved: a variation bucketed without the stored assignment must not replace it.
-
setAsyncExecutor
Executor for the client's asynchronous entry points: offloading blockingStickyBucketServicecalls and composing async evaluations. The synchronous evaluation API never uses it; it calls a blocking service on the calling thread. When null, the client creates its own bounded daemon pool and shuts it down inshutdown(); a caller-supplied executor is never shut down by the SDK. On JDK 21+, passExecutors.newVirtualThreadPerTaskExecutor()so blocking offloads scale with the store instead of a fixed pool. -
setStickyBucketCacheTtlSeconds
Opt-in TTL, in seconds, for caching sticky bucket reads per user attributes. Null or non-positive (the default) disables caching: assignments are fetched per evaluation, so assignment changes made by other processes are picked up promptly. Enabling trades that freshness for fewer store lookups on hot users. -
setStickyBucketCacheSize
Maximum entries in the opt-in sticky bucket read cache (default 1000). Non-positive disables caching. Only meaningful whenstickyBucketCacheTtlSecondsis set. -
setStickyBucketTimeout
How long the multi-user client waits for one sticky bucket store call, read or save (defaultDEFAULT_STICKY_BUCKET_TIMEOUT, 5 seconds). A read that takes longer is handled like any failed read: that evaluation continues with normal bucketing and saves nothing. A save that takes longer is handled like any failed save.Duration.ZEROdisables the timeout.The store call itself is not cancelled. A blocking
StickyBucketServicecalled by the synchronous evaluation API runs on the calling thread and is bounded by its own client's timeout, not by this one. -
equals
-
hashCode
public int hashCode() -
toString
-
GrowthBookClient.addFeatureRefreshListener(...)orGrowthBookClient.subscribeFeatureRefreshListener(...)after constructing the client.