Class Options
java.lang.Object
growthbook.sdk.java.multiusermode.configurations.Options
-
Nested Class Summary
Nested Classes -
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) 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 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)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.List of user's attributes keys.The standard cache TTL to use.A function that takesExperimentandExperimentResultas arguments.getUrl()inthashCode()booleanbooleanvoidsetAllowUrlOverrides(Boolean allowUrlOverrides) Boolean flag to allow URL overrides (default: false)voidsetApiHost(String apiHost) 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.voidsetStickyBucketIdentifierAttributes(List<String> stickyBucketIdentifierAttributes) List of user's attributes keys.voidsetStickyBucketService(StickyBucketService stickyBucketService) Service that provide functionality of Sticky BucketingvoidsetSwrTtlSeconds(Integer swrTtlSeconds) The standard cache TTL to use.voidsetTrackingCallBackWithUser(TrackingCallbackWithUser trackingCallBackWithUser) A function that takesExperimentandExperimentResultas arguments.voidtoString()
-
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) 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, @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)
-
-
Method Details
-
setGlobalForcedVariationsMap
-
getRefreshingStrategy
-
getCacheMode
-
getCacheDirectory
-
isSseReconnectOnFailure
public boolean isSseReconnectOnFailure() -
getStickyBucketService
-
setInMemoryStickyBucketService
public void setInMemoryStickyBucketService() -
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
List of user's attributes keys. -
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. -
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) List of user's attributes keys. -
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. -
equals
-
hashCode
public int hashCode() -
toString
-
GrowthBookClient.addFeatureRefreshListener(...)orGrowthBookClient.subscribeFeatureRefreshListener(...)after constructing the client.