Class EvaluationSeriesContext
java.lang.Object
com.launchdarkly.sdk.android.integrations.EvaluationSeriesContext
Represents parameters associated with a feature flag evaluation. An instance of this class is provided to some
stages of series of a
Hook implementation. For example, see Hook.beforeEvaluation(EvaluationSeriesContext, Map)-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionEvaluationSeriesContext(String method, String key, LDContext context, LDValue defaultValue) EvaluationSeriesContext(String method, String key, LDContext context, LDValue defaultValue, EvaluationExposureKeySupplier exposureKeySupplier, DataModel.Flag flag) Used by the SDK, which has read the flag the evaluation will return a result from. -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns the key identifying the result this evaluation will return, for a hook that decides what to do with an evaluation by whether it has seen the same result before.inthashCode()
-
Field Details
-
method
The variation method that was used to invoke the evaluation. The stability of this string is not guaranteed and should not be used in conditional logic. -
flagKey
The key of the feature flag being evaluated. -
context
The context the evaluation was for. -
defaultValue
The user-provided default value for the evaluation.
-
-
Constructor Details
-
EvaluationSeriesContext
- Parameters:
method- the variation method that was used to invoke the evaluation.key- the key of the feature flag being evaluated.context- the context the evaluation was for.defaultValue- the user-provided default value for the evaluation.
-
EvaluationSeriesContext
public EvaluationSeriesContext(String method, String key, LDContext context, LDValue defaultValue, @Nullable EvaluationExposureKeySupplier exposureKeySupplier, @Nullable DataModel.Flag flag) Used by the SDK, which has read the flag the evaluation will return a result from. Application code has no use for this constructor: a context built with the four-argument one has no exposure key, andgetEvaluationExposureKey()explains what that means for a hook that wanted one.This constructor is not stable, and not subject to any backwards compatibility guarantees or semantic versioning. It is experimental.
- Parameters:
method- the variation method that was used to invoke the evaluation.key- the key of the feature flag being evaluated.context- the context the evaluation was for.defaultValue- the user-provided default value for the evaluation.exposureKeySupplier- builds the key identifying the result of this evaluation, or null if the result is not knownflag- the evaluation's own read of the flag, or null if it was not found
-
-
Method Details
-
getEvaluationExposureKey
Returns the key identifying the result this evaluation will return, for a hook that decides what to do with an evaluation by whether it has seen the same result before.DedupingHookis such a hook.This method is not stable, and not subject to any backwards compatibility guarantees or semantic versioning. It is experimental.
The key describes the evaluation's own read of the flag, the one its result is derived from, so it is available to
Hook.beforeEvaluation(EvaluationSeriesContext, Map)as well as to the after stage, and every hook that asks is told about the same result. It is built on the ask, so an evaluation whose hooks never ask does not pay for one.- Returns:
- the key identifying this evaluation's result, or null if this context was not built by the SDK and so has no result to describe
-
equals
-
hashCode
public int hashCode()
-