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 running an
Experiment given a specific GBContext
- inExperiment (boolean) - Whether or not the user is part of the experiment
- variationId (int) - The array index of the assigned variation
- value (any) - The array value of the assigned variation
- hashUsed (boolean) - If a hash was used to assign a variation
- hashAttribute (string) - The user attribute used to assign a variation
- hashValue (string) - The value of that attribute
- featureId (string or null) - The id of the feature (if any) that the experiment came from
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic <ValueType>
com.google.gson.JsonSerializer<ExperimentResult<ValueType>>A Gson serializer forExperimentResulttoJson()Serialized JSON string of theExperimentResult
-
Constructor Details
-
ExperimentResult
public ExperimentResult()
-
-
Method Details
-
toJson
Serialized JSON string of theExperimentResult- Returns:
- JSON string
-
getSerializer
public static <ValueType> com.google.gson.JsonSerializer<ExperimentResult<ValueType>> getSerializer()A Gson serializer forExperimentResult- Type Parameters:
ValueType- type of the experiment- Returns:
- a Gson serializer
-