EvaluationEvent Class
- java.
lang. Object - com.
azure. spring. cloud. feature. management. models. EvaluationEvent
- com.
public class EvaluationEvent
Event tracking the evaluation of a feature flag. This class captures information about a feature flag evaluation, including which user evaluated it, whether it was enabled, which variant was returned (if any), and the reason for the variant assignment.
Constructor Summary
| Constructor | Description |
|---|---|
| EvaluationEvent(FeatureDefinition feature) |
Creates an Evaluation Event for the given feature. |
Method Summary
| Modifier and Type | Method and Description |
|---|---|
|
Feature |
getFeature()
Gets the feature flag that was evaluated. |
|
Variant |
getReason()
Gets the reason why a particular variant was assigned during this evaluation. |
| String |
getUser()
Gets the identifier of the user who evaluated the feature flag. |
| Variant |
getVariant()
Gets the variant that was assigned during this feature flag evaluation. |
| boolean |
isEnabled()
Determines whether the feature flag was enabled for this evaluation. |
|
Evaluation |
setEnabled(boolean enabled)
Sets whether the feature flag was enabled for this evaluation. |
|
Evaluation |
setReason(VariantAssignmentReason reason)
Sets the reason why a particular variant was assigned during this evaluation. |
|
Evaluation |
setUser(String user)
Sets the identifier of the user who evaluated the feature flag. |
|
Evaluation |
setVariant(Variant variant)
Sets the variant that was assigned during this feature flag evaluation. |
Methods inherited from java.lang.Object
Constructor Details
EvaluationEvent
public EvaluationEvent(FeatureDefinition feature)
Creates an Evaluation Event for the given feature. This constructor initializes a new evaluation event with the specified feature flag, while setting default values for other properties.
Parameters:
Method Details
getFeature
public FeatureDefinition getFeature()
Gets the feature flag that was evaluated.
Returns:
getReason
public VariantAssignmentReason getReason()
Gets the reason why a particular variant was assigned during this evaluation. This helps track the decision-making process behind the variant selection and can be useful for debugging and analytics.
Returns:
getUser
public String getUser()
Gets the identifier of the user who evaluated the feature flag. This is useful for targeting specific users with features and for analytics tracking.
Returns:
getVariant
public Variant getVariant()
Gets the variant that was assigned during this feature flag evaluation. This is relevant for feature flags that support multiple variants rather than just being enabled or disabled.
Returns:
isEnabled
public boolean isEnabled()
Determines whether the feature flag was enabled for this evaluation. This indicates the result of the evaluation process for the feature flag.
Returns:
setEnabled
public EvaluationEvent setEnabled(boolean enabled)
Sets whether the feature flag was enabled for this evaluation. This allows recording the result of the feature flag evaluation process.
Parameters:
Returns:
setReason
public EvaluationEvent setReason(VariantAssignmentReason reason)
Sets the reason why a particular variant was assigned during this evaluation. This documents the logic behind why a specific variant was chosen, which can be useful for troubleshooting and analytics purposes.
Parameters:
Returns:
setUser
public EvaluationEvent setUser(String user)
Sets the identifier of the user who evaluated the feature flag. This allows tracking which user accessed a particular feature.
Parameters:
Returns:
setVariant
public EvaluationEvent setVariant(Variant variant)
Sets the variant that was assigned during this feature flag evaluation. This allows recording which specific variant of a feature flag was selected when multiple variants are supported.
Parameters:
Returns: