Package growthbook.sdk.java.model
Class ExperimentResult<ValueType>
java.lang.Object
growthbook.sdk.java.model.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
Nested ClassesModifier and TypeClassDescriptionstatic class -
Constructor Summary
ConstructorsConstructorDescriptionExperimentResult(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 anExperimentgiven a specificGBContext -
Method Summary
Modifier and TypeMethodDescriptionstatic <ValueType>
ExperimentResult.ExperimentResultBuilder<ValueType>builder()booleanThe 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 variationinthashCode()voidThe hash value used to assign a variation (float from 0 to 1)voidsetFeatureId(String featureId) The id of the feature (if any) that the experiment came fromvoidsetHashAttribute(String hashAttribute) The user attribute used to assign a variationvoidsetHashUsed(Boolean hashUsed) If a hash was used to assign a variationvoidsetHashValue(String hashValue) The value of that attributevoidsetInExperiment(Boolean inExperiment) Whether the user is part of the experimentvoidThe unique key for the assigned variationvoidThe human-readable name of the assigned variationvoidsetPassThrough(Boolean passThrough) Used for holdout groupsvoidsetStickyBucketUsed(Boolean stickyBucketUsed) If sticky bucketing was used to assign a variationvoidThe array value of the assigned variationvoidsetVariationId(Integer variationId) The array index of the assigned variationtoJson()Serialized JSON string of theExperimentResulttoString()
-
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 anExperimentgiven 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
-