Package growthbook.sdk.java
Class ExperimentResult<ValueType>
java.lang.Object
growthbook.sdk.java.ExperimentResult<ValueType>
- Type Parameters:
ValueType
- generic type for the value type for this experiment's variations.
The result of an
GrowthBook.run(Experiment)
call-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
-
Constructor Summary
ConstructorDescriptionExperimentResult
(ValueType value, Integer variationId, Boolean inExperiment, String hashAttribute, String hashValue, String featureId, Boolean hashUsed, String key, String name, Float bucket, Boolean passThrough, Boolean stickyBucketUsed) The result of running anExperiment
given a specificGBContext
-
Method Summary
Modifier and TypeMethodDescriptionstatic <ValueType>
ExperimentResult.ExperimentResultBuilder<ValueType>builder()
boolean
The hash value used to assign a variation (float from 0 to 1)The id of the feature (if any) that the experiment came fromThe user attribute used to assign a variationIf a hash was used to assign a variationThe value of that attributeWhether the user is part of the experimentgetKey()
The unique key for the assigned variationgetName()
The human-readable name of the assigned variationUsed for holdout groupsIf sticky bucketing was used to assign a variationgetValue()
The array value of the assigned variationThe array index of the assigned variationint
hashCode()
void
The hash value used to assign a variation (float from 0 to 1)void
setFeatureId
(String featureId) The id of the feature (if any) that the experiment came fromvoid
setHashAttribute
(String hashAttribute) The user attribute used to assign a variationvoid
setHashUsed
(Boolean hashUsed) If a hash was used to assign a variationvoid
setHashValue
(String hashValue) The value of that attributevoid
setInExperiment
(Boolean inExperiment) Whether the user is part of the experimentvoid
The unique key for the assigned variationvoid
The human-readable name of the assigned variationvoid
setPassThrough
(Boolean passThrough) Used for holdout groupsvoid
setStickyBucketUsed
(Boolean stickyBucketUsed) If sticky bucketing was used to assign a variationvoid
The array value of the assigned variationvoid
setVariationId
(Integer variationId) The array index of the assigned variationtoJson()
Serialized JSON string of theExperimentResult
toString()
-
Constructor Details
-
ExperimentResult
public ExperimentResult(@Nullable ValueType value, @Nullable Integer variationId, Boolean inExperiment, @Nullable String hashAttribute, @Nullable String hashValue, @Nullable String featureId, Boolean hashUsed, @Nullable String key, @Nullable String name, @Nullable Float bucket, @Nullable Boolean passThrough, @Nullable Boolean stickyBucketUsed) The result of running anExperiment
given a specificGBContext
- Parameters:
value
- The array value of the assigned variationvariationId
- The array index of the assigned variationinExperiment
- Whether the user is part of the experiment or nothashAttribute
- The user attribute used to assign a variation (default: "id")hashValue
- The value of that attributefeatureId
- The id of the feature (if any) that the experiment came fromhashUsed
- If a hash was used to assign a variationkey
- The experiment key, if anyname
- The human-readable name of the assigned variationbucket
- The hash value used to assign a variation (float from 0 to 1)passThrough
- Used for holdout groups
-
-
Method Details
-
toJson
Serialized JSON string of theExperimentResult
- Returns:
- JSON string
-
builder
-
getValue
The array value of the assigned variation -
getVariationId
The array index of the assigned variation -
getInExperiment
Whether the user is part of the experiment -
getHashAttribute
The user attribute used to assign a variation -
getHashValue
The value of that attribute -
getFeatureId
The id of the feature (if any) that the experiment came from -
getHashUsed
If a hash was used to assign a variation -
getKey
The unique key for the assigned variation -
getName
The human-readable name of the assigned variation -
getBucket
The hash value used to assign a variation (float from 0 to 1) -
getPassThrough
Used for holdout groups -
getStickyBucketUsed
If sticky bucketing was used to assign a variation -
setValue
The array value of the assigned variation -
setVariationId
The array index of the assigned variation -
setInExperiment
Whether the user is part of the experiment -
setHashAttribute
The user attribute used to assign a variation -
setHashValue
The value of that attribute -
setFeatureId
The id of the feature (if any) that the experiment came from -
setHashUsed
If a hash was used to assign a variation -
setKey
The unique key for the assigned variation -
setName
The human-readable name of the assigned variation -
setBucket
The hash value used to assign a variation (float from 0 to 1) -
setPassThrough
Used for holdout groups -
setStickyBucketUsed
If sticky bucketing was used to assign a variation -
equals
-
hashCode
public int hashCode() -
toString
-