Package growthbook.sdk.java
Class GrowthBook
java.lang.Object
growthbook.sdk.java.GrowthBook
GrowthBook SDK class.
Build a context with
GBContext.builder() or the GBContext constructor
and pass it as an argument to the class constructor.-
Constructor Summary
ConstructorsConstructorDescriptionNo-args constructor.GrowthBook(GBContext context) Initialize the GrowthBook SDK with a providedGBContext -
Method Summary
Modifier and TypeMethodDescriptionvoiddestroy()<ValueType>
FeatureResult<ValueType>evalFeature(String key, Class<ValueType> valueTypeClass) evaluateCondition(String attributesJsonString, String conditionJsonString) getFeatureValue(String featureKey, Boolean defaultValue) getFeatureValue(String featureKey, Double defaultValue) getFeatureValue(String featureKey, Float defaultValue) getFeatureValue(String featureKey, Integer defaultValue) getFeatureValue(String featureKey, Object defaultValue) getFeatureValue(String featureKey, String defaultValue) <ValueType>
ValueTypegetFeatureValue(String featureKey, ValueType defaultValue, Class<ValueType> gsonDeserializableClass) <ValueType>
ExperimentResult<ValueType>run(Experiment<ValueType> experiment) voidsetAttributes(String attributesJsonString) voidsetFeatures(String featuresJsonString) voidsubscribe(ExperimentRunCallback callback)
-
Constructor Details
-
GrowthBook
Initialize the GrowthBook SDK with a providedGBContext- Parameters:
context-GBContext
-
GrowthBook
public GrowthBook()No-args constructor. AGBContextwith default values is created. It's recommended to create your own context withGBContext.builder()or theGBContextconstructor
-
-
Method Details
-
evalFeature
@Nullable public <ValueType> FeatureResult<ValueType> evalFeature(String key, Class<ValueType> valueTypeClass) -
setFeatures
-
setAttributes
-
run
-
isOn
-
isOff
-
getFeatureValue
-
getFeatureValue
-
getFeatureValue
-
getFeatureValue
-
getFeatureValue
-
getFeatureValue
-
evaluateCondition
-
getFeatureValue
-
destroy
public void destroy() -
subscribe
-