-
public final class EvaluationContextRepresents the context used for evaluating feature flags.
This context contains a targeting key and optional attributes that determine which flag values should be returned for a given user or session. The targeting key ensures consistent flag evaluation across requests for the same entity.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public classEvaluationContext.Companion
-
Field Summary
Fields Modifier and Type Field Description private final StringtargetingKeyprivate final Map<String, String>attributes
-
Constructor Summary
Constructors Constructor Description EvaluationContext(String targetingKey, Map<String, String> attributes)
-
Method Summary
Modifier and Type Method Description final StringgetTargetingKey()The unique identifier used for targeting and bucketing flag evaluation. final Map<String, String>getAttributes()Additional attributes used for targeting flag evaluation. -
-
Method Detail
-
getTargetingKey
final String getTargetingKey()
The unique identifier used for targeting and bucketing flag evaluation.
Must be consistent for the same entity to ensure consistent flag behavior across requests. Examples: user ID, company ID, device ID.
-
getAttributes
final Map<String, String> getAttributes()
Additional attributes used for targeting flag evaluation.
All values must be strings. You are responsible for converting numbers, booleans, and other types to strings before passing them to the context.
Example:
mapOf("email" to "user@example.com", "age" to "25", "premium" to "true")
-
-
-
-