Package growthbook.sdk.java
Class Experiment.ExperimentBuilder<ValueType>
java.lang.Object
growthbook.sdk.java.Experiment.ExperimentBuilder<ValueType>
- Enclosing class:
- Experiment<ValueType>
-
Method Summary
Modifier and TypeMethodDescriptionbucketVersion
(Integer bucketVersion) The sticky bucket version number that can be used to force a re-bucketing of users (default to 0)build()
conditionJson
(com.google.gson.JsonObject conditionJson) 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 applyAll users included in the experiment will be forced into the specific variation indexhashAttribute
(String hashAttribute) What user attribute should be used to assign variations (defaults to `id`) All users included in the experiment will be forced into the specific variation indexhashVersion
(Integer hashVersion) The hash version to use (default to 1)If set to false, always return the control (first variation)The globally unique identifier for the experimentmeta
(ArrayList<VariationMeta> meta) Meta info about the 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`).Identifier of the current experiment phaseranges
(ArrayList<BucketRange> ranges) Array of ranges, one per variationThe hash seed to usetoString()
variations
(ArrayList<ValueType> variations) The different variations to choose betweenHow to weight traffic between variations.
-
Method Details
-
key
The globally unique identifier for the experiment- Returns:
this
.
-
variations
The different variations to choose between- Returns:
this
.
-
weights
How to weight traffic between variations. Must add to 1.- Returns:
this
.
-
isActive
If set to false, always return the control (first variation)- Returns:
this
.
-
coverage
What percent of users should be included in the experiment (between 0 and 1, inclusive)- Returns:
this
.
-
conditionJson
public Experiment.ExperimentBuilder<ValueType> conditionJson(com.google.gson.JsonObject conditionJson) Optional targeting condition- Returns:
this
.
-
parentConditions
public Experiment.ExperimentBuilder<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
.
-
namespace
Deprecated.A tuple that contains the namespace identifier, plus a range of coverage for the experiment- Returns:
this
.
-
force
All users included in the experiment will be forced into the specific variation index- Returns:
this
.
-
hashAttribute
What user attribute should be used to assign variations (defaults to `id`) All users included in the experiment will be forced into the specific variation index- Returns:
this
.
-
hashVersion
The hash version to use (default to 1)- Returns:
this
.
-
ranges
Array of ranges, one per variation- Returns:
this
.
-
meta
Meta info about the variations- Returns:
this
.
-
filters
Array of filters to apply- Returns:
this
.
-
seed
The hash seed to use- Returns:
this
.
-
name
Human-readable name for the experiment- Returns:
this
.
-
phase
Identifier of the current experiment phase- Returns:
this
.
-
fallbackAttribute
public Experiment.ExperimentBuilder<ValueType> fallbackAttribute(@Nullable String fallbackAttribute) When using sticky bucketing, can be used as a fallback to assign variations- Returns:
this
.
-
disableStickyBucketing
public Experiment.ExperimentBuilder<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
The sticky bucket version number that can be used to force a re-bucketing of users (default to 0)- Returns:
this
.
-
minBucketVersion
Any users with a sticky bucket version less than this will be excluded from the experiment- Returns:
this
.
-
build
-
toString
-