Package growthbook.sdk.java.repository
Class FeatureSnapshot
java.lang.Object
growthbook.sdk.java.repository.FeatureSnapshot
Immutable view of one successfully processed features payload: the raw JSON
strings and their parsed forms, captured together.
The repository swaps a single AtomicReference<FeatureSnapshot> on
refresh, so a reader always observes features and saved groups from the SAME
payload. Reading the parts through separate getters across a concurrent
refresh could otherwise pair new features with old saved groups.
-
Field Details
-
EMPTY
-
-
Method Details
-
of
public static FeatureSnapshot of(String featuresJson, String savedGroupsJson, Map<String, Feature<?>> parsedFeatures, com.google.gson.JsonObject parsedSavedGroups) Builds a snapshot from pre-parsed parts. Intended for tests and callers constructing synthetic payloads; the repository builds its own snapshots from fetched responses.- Parameters:
featuresJson- raw features JSONsavedGroupsJson- raw saved groups JSONparsedFeatures- parsed feature definitionsparsedSavedGroups- parsed saved groups- Returns:
- an immutable snapshot of the supplied parts
-
getFeaturesJson
-
getSavedGroupsJson
-
getParsedFeatures
-
getParsedSavedGroups
public com.google.gson.JsonObject getParsedSavedGroups()
-