T - The type of the flag being evaluated.public interface Hook<T>
| Modifier and Type | Method and Description |
|---|---|
default void |
after(HookContext<T> ctx,
FlagEvaluationDetails<T> details,
Map<String,Object> hints)
Runs after a flag is resolved.
|
default Optional<EvaluationContext> |
before(HookContext<T> ctx,
Map<String,Object> hints)
Runs before flag is resolved.
|
default void |
error(HookContext<T> ctx,
Exception error,
Map<String,Object> hints)
Run when evaluation encounters an error.
|
default void |
finallyAfter(HookContext<T> ctx,
Map<String,Object> hints)
Run after flag evaluation, including any error processing.
|
default boolean |
supportsFlagValueType(FlagValueType flagValueType) |
default Optional<EvaluationContext> before(HookContext<T> ctx, Map<String,Object> hints)
ctx - Information about the particular flag evaluationhints - An immutable mapping of data for users to communicate to the hooks.EvaluationContext. If returned, it will be merged with the EvaluationContext
instances from other hooks, the client and API.default void after(HookContext<T> ctx, FlagEvaluationDetails<T> details, Map<String,Object> hints)
ctx - Information about the particular flag evaluationdetails - Information about how the flag was resolved, including any resolved values.hints - An immutable mapping of data for users to communicate to the hooks.default void error(HookContext<T> ctx, Exception error, Map<String,Object> hints)
ctx - Information about the particular flag evaluationerror - The exception that was thrown.hints - An immutable mapping of data for users to communicate to the hooks.default void finallyAfter(HookContext<T> ctx, Map<String,Object> hints)
ctx - Information about the particular flag evaluationhints - An immutable mapping of data for users to communicate to the hooks.default boolean supportsFlagValueType(FlagValueType flagValueType)
Copyright © 2023. All rights reserved.