Class InMemoryStickyBucketServiceImpl
java.lang.Object
growthbook.sdk.java.stickyBucketing.InMemoryStickyBucketServiceImpl
- All Implemented Interfaces:
StickyBucketService
For simple bucket persistence using the in memory's storage(Map) (can be polyfilled for other environments)
-
Constructor Summary
ConstructorsConstructorDescriptionInMemoryStickyBucketServiceImpl(Map<String, StickyAssignmentsDocument> localStorage) -
Method Summary
Modifier and TypeMethodDescriptiongetAllAssignments(Map<String, String> attributes) Method for getting sticky bucket assignments from attributes of contextgetAssignments(String attributeName, String attributeValue) Method for saving assignments document to cachevoidMethod for saving assignments document to cache
-
Constructor Details
-
InMemoryStickyBucketServiceImpl
-
-
Method Details
-
getAssignments
Method for saving assignments document to cache- Specified by:
getAssignmentsin interfaceStickyBucketService- Parameters:
attributeName- attributeName with attributeValue together present a key that us for find proper StickyAssignmentsDocumentattributeValue- attributeName with attributeValue together present a key that us for find proper StickyAssignmentsDocument- Returns:
- StickyAssignmentsDocument
-
saveAssignments
Method for saving assignments document to cache- Specified by:
saveAssignmentsin interfaceStickyBucketService- Parameters:
doc- StickyAssignmentsDocument
-
getAllAssignments
Method for getting sticky bucket assignments from attributes of context- Specified by:
getAllAssignmentsin interfaceStickyBucketService- Parameters:
attributes- Map of String key and String value that you have in GBContext- Returns:
- Map with key String and value StickyAssignmentsDocument
-