Package dev.openfeature.sdk
Interface EvaluationContext
- All Superinterfaces:
Structure
- All Known Implementing Classes:
ImmutableContext
,MutableContext
The EvaluationContext is a container for arbitrary contextual data
that can be used as a basis for dynamic evaluation.
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionmerge
(EvaluationContext overridingContext) Merges this EvaluationContext object with the second overriding the this in case of conflict.static void
mergeMaps
(Function<Map<String, Value>, Structure> newStructure, Map<String, Value> base, Map<String, Value> overriding) Recursively merges the overriding map into the base Value map.Methods inherited from interface dev.openfeature.sdk.Structure
asMap, asObjectMap, asUnmodifiableMap, convertValue, getValue, isEmpty, keySet
-
Field Details
-
TARGETING_KEY
- See Also:
-
-
Method Details
-
getTargetingKey
String getTargetingKey() -
merge
Merges this EvaluationContext object with the second overriding the this in case of conflict.- Parameters:
overridingContext
- overriding context- Returns:
- resulting merged context
-
mergeMaps
static void mergeMaps(Function<Map<String, Value>, Structure> newStructure, Map<String, Value> base, Map<String, Value> overriding) Recursively merges the overriding map into the base Value map. The base map is mutated, the overriding map is not. Null maps will cause no-op.- Parameters:
newStructure
- function to create the right structure(s) for Valuesbase
- base map to mergeoverriding
- overriding map to merge
-