Package com.launchdarkly.sdk.server
Interface EvaluatorInterface
-
public interface EvaluatorInterfaceAn Evaluator is able to calculate evaluation results for flags against the provided context.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description FeatureFlagsStateallFlagsState(LDContext context, FlagsStateOption... options)Evaluates all flags.com.launchdarkly.sdk.server.EvalResultAndFlagevalAndFlag(java.lang.String method, java.lang.String flagKey, LDContext context, LDValue defaultValue, LDValueType requireType, com.launchdarkly.sdk.server.EvaluationOptions options)Evaluates the provided flag.
-
-
-
Method Detail
-
evalAndFlag
com.launchdarkly.sdk.server.EvalResultAndFlag evalAndFlag(java.lang.String method, java.lang.String flagKey, LDContext context, LDValue defaultValue, LDValueType requireType, com.launchdarkly.sdk.server.EvaluationOptions options)Evaluates the provided flag.- Parameters:
method- the top level customer facing method that led to this invocationflagKey- of the flag that will be evaluatedcontext- to use during the evaluationdefaultValue- the value that will be returned in the result if an issue prevents the evaluator from successfully calculating an evaluation result.requireType- that will be asserted against the evaluator's result. If the assertion fails, the default value is used in the returned result.options- that are used to control more specific behavior of the evaluation- Returns:
- the evaluation result and flag object
-
allFlagsState
FeatureFlagsState allFlagsState(LDContext context, FlagsStateOption... options)
Evaluates all flags.It is up to each implementation whether events will be logged during evaluation.
- Parameters:
context- to use during the evaluationoptions- optionalFlagsStateOptionvalues affecting how the state is computed- Returns:
- a
FeatureFlagsStateobject (will never be null; seeFeatureFlagsState.isValid()
-
-