Package com.launchdarkly.sdk.android
Class HookRunner
java.lang.Object
com.launchdarkly.sdk.android.HookRunner
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfacestatic interface -
Constructor Summary
ConstructorsConstructorDescriptionHookRunner(LDLogger logger, List<Hook> initialHooks) Builds a runner whose evaluations describe no result, so a hook that asks what one identifies is told nothing and treats every evaluation as its own.HookRunner(LDLogger logger, List<Hook> initialHooks, EvaluationExposureKeySupplier exposureKeySupplier) -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds a hook, which the next series to begin will run.voidafterTrack(String key, LDContext context, LDValue data, Double metricValue) withEvaluation(String method, String key, LDContext context, LDValue defaultValue, DataModel.Flag flag, HookRunner.EvaluationMethod evalMethod) Runs the evaluation series around an evaluation, against the caller's own read of the flag.withEvaluation(String method, String key, LDContext context, LDValue defaultValue, HookRunner.EvaluationMethod evalMethod) Runs the evaluation series around an evaluation of a flag the caller has not read, so a hook that asks what the evaluation's result identifies is told nothing.
-
Constructor Details
-
HookRunner
Builds a runner whose evaluations describe no result, so a hook that asks what one identifies is told nothing and treats every evaluation as its own. -
HookRunner
public HookRunner(LDLogger logger, List<Hook> initialHooks, EvaluationExposureKeySupplier exposureKeySupplier)
-
-
Method Details
-
addHook
Adds a hook, which the next series to begin will run. A series already under way runs the hooks it began with.- Parameters:
hook- the hook to add
-
withEvaluation
public EvaluationDetail<LDValue> withEvaluation(String method, String key, LDContext context, LDValue defaultValue, HookRunner.EvaluationMethod evalMethod) Runs the evaluation series around an evaluation of a flag the caller has not read, so a hook that asks what the evaluation's result identifies is told nothing. -
withEvaluation
public EvaluationDetail<LDValue> withEvaluation(String method, String key, LDContext context, LDValue defaultValue, DataModel.Flag flag, HookRunner.EvaluationMethod evalMethod) Runs the evaluation series around an evaluation, against the caller's own read of the flag.- Parameters:
flag- the read the evaluation derives its result from, so that a hook is told about the result the evaluation returns rather than about a later read of the store
-
identify
-
afterTrack
-