Package growthbook.sdk.java.model
Class FeatureRule.FeatureRuleBuilder<ValueType>
java.lang.Object
growthbook.sdk.java.model.FeatureRule.FeatureRuleBuilder<ValueType>
- Enclosing class:
- FeatureRule<ValueType>
-
Method Summary
Modifier and TypeMethodDescriptionbucketVersion
(Integer bucketVersion) A sticky bucket version number that can be used to force a re-bucketing of users (default to 0)build()
condition
(com.google.gson.JsonObject condition) Optional targeting conditionWhat percent of users should be included in the experiment (between 0 and 1, inclusive)disableStickyBucketing
(Boolean disableStickyBucketing) If true, sticky bucketing will be disabled for this experiment.fallbackAttribute
(String fallbackAttribute) When using sticky bucketing, can be used as a fallback to assign variationsArray of filters to apply to the ruleforce
(OptionalField<ValueType> force) Immediately force a specific value (ignore every other option besides condition and coverage)hashAttribute
(String hashAttribute) What user attribute should be used to assign variations (defaults to id)hashVersion
(Integer hashVersion) The hash version to use (default to 1)Unique feature rule idThe globally unique tracking key for the experiment (default to the feature key)meta
(ArrayList<VariationMeta> meta) Meta info about the experiment variationsminBucketVersion
(Integer minBucketVersion) Any users with a sticky bucket version less than this will be excluded from the experimentHuman-readable name for the experimentDeprecated.parentConditions
(ArrayList<ParentCondition> parentConditions) Each item defines a prerequisite where a `condition` must evaluate against a parent feature's value (identified by `id`).The phase id of the experimentrange
(BucketRange range) A more precise version of coverageranges
(ArrayList<BucketRange> ranges) Ranges for experiment variationsSeed to use for hashingtoString()
Array of tracking calls to firevariations
(ArrayList<ValueType> variations) Run an experiment (A/B test) and randomly choose between these variationsHow to weight traffic between variations.
-
Method Details
-
id
Unique feature rule id- Returns:
this
.
-
key
The globally unique tracking key for the experiment (default to the feature key)- Returns:
this
.
-
coverage
What percent of users should be included in the experiment (between 0 and 1, inclusive)- Returns:
this
.
-
force
Immediately force a specific value (ignore every other option besides condition and coverage)- Returns:
this
.
-
variations
public FeatureRule.FeatureRuleBuilder<ValueType> variations(@Nullable ArrayList<ValueType> variations) Run an experiment (A/B test) and randomly choose between these variations- Returns:
this
.
-
weights
How to weight traffic between variations. Must add to 1.- Returns:
this
.
-
namespace
@Deprecated public FeatureRule.FeatureRuleBuilder<ValueType> namespace(@Nullable Namespace namespace) Deprecated.A tuple that contains the namespace identifier, plus a range of coverage for the experiment.- Returns:
this
.
-
hashAttribute
What user attribute should be used to assign variations (defaults to id)- Returns:
this
.
-
condition
public FeatureRule.FeatureRuleBuilder<ValueType> condition(@Nullable com.google.gson.JsonObject condition) Optional targeting condition- Returns:
this
.
-
parentConditions
public FeatureRule.FeatureRuleBuilder<ValueType> parentConditions(@Nullable ArrayList<ParentCondition> parentConditions) Each item defines a prerequisite where a `condition` must evaluate against a parent feature's value (identified by `id`). If `gate` is true, then this is a blocking feature-level prerequisite; otherwise it applies to the current rule only.- Returns:
this
.
-
hashVersion
The hash version to use (default to 1)- Returns:
this
.
-
range
A more precise version of coverage- Returns:
this
.
-
ranges
Ranges for experiment variations- Returns:
this
.
-
meta
Meta info about the experiment variations- Returns:
this
.
-
filters
Array of filters to apply to the rule- Returns:
this
.
-
seed
Seed to use for hashing- Returns:
this
.
-
name
Human-readable name for the experiment- Returns:
this
.
-
phase
The phase id of the experiment- Returns:
this
.
-
fallbackAttribute
public FeatureRule.FeatureRuleBuilder<ValueType> fallbackAttribute(@Nullable String fallbackAttribute) When using sticky bucketing, can be used as a fallback to assign variations- Returns:
this
.
-
disableStickyBucketing
public FeatureRule.FeatureRuleBuilder<ValueType> disableStickyBucketing(@Nullable Boolean disableStickyBucketing) If true, sticky bucketing will be disabled for this experiment. (Note: sticky bucketing is only available if a StickyBucketingService is provided in the Context)- Returns:
this
.
-
bucketVersion
A sticky bucket version number that can be used to force a re-bucketing of users (default to 0)- Returns:
this
.
-
minBucketVersion
public FeatureRule.FeatureRuleBuilder<ValueType> minBucketVersion(@Nullable Integer minBucketVersion) Any users with a sticky bucket version less than this will be excluded from the experiment- Returns:
this
.
-
tracks
public FeatureRule.FeatureRuleBuilder<ValueType> tracks(@Nullable ArrayList<TrackData<ValueType>> tracks) Array of tracking calls to fire- Returns:
this
.
-
build
-
toString
-