66import static dev .openfeature .sdk .testutils .TestFlagsUtils .OBJECT_FLAG_KEY ;
77import static dev .openfeature .sdk .testutils .TestFlagsUtils .STRING_FLAG_KEY ;
88
9+ import dev .openfeature .sdk .BooleanHook ;
910import dev .openfeature .sdk .Client ;
11+ import dev .openfeature .sdk .DoubleHook ;
1012import dev .openfeature .sdk .EvaluationContext ;
11- import dev .openfeature .sdk .Hook ;
1213import dev .openfeature .sdk .HookContext ;
1314import dev .openfeature .sdk .ImmutableContext ;
1415import dev .openfeature .sdk .ImmutableStructure ;
16+ import dev .openfeature .sdk .IntegerHook ;
1517import dev .openfeature .sdk .NoOpProvider ;
18+ import dev .openfeature .sdk .ObjectHook ;
1619import dev .openfeature .sdk .OpenFeatureAPI ;
20+ import dev .openfeature .sdk .StringHook ;
1721import dev .openfeature .sdk .Value ;
1822import java .util .HashMap ;
1923import java .util .Map ;
2529
2630/**
2731 * Runs a large volume of flag evaluations on a VM with 1G memory and GC
28- * completely disabled so we can take a heap-dump.
32+ * completely disabled, so we can take a heap-dump.
2933 */
3034public class AllocationBenchmark {
3135
@@ -48,31 +52,31 @@ public void run() {
4852 Map <String , Value > clientAttrs = new HashMap <>();
4953 clientAttrs .put ("client" , new Value (2 ));
5054 client .setEvaluationContext (new ImmutableContext (clientAttrs ));
51- client .addHooks (new Hook < Object > () {
55+ client .addHooks (new ObjectHook () {
5256 @ Override
5357 public Optional <EvaluationContext > before (HookContext <Object > ctx , Map <String , Object > hints ) {
5458 return Optional .ofNullable (new ImmutableContext ());
5559 }
5660 });
57- client .addHooks (new Hook < String > () {
61+ client .addHooks (new StringHook () {
5862 @ Override
5963 public Optional <EvaluationContext > before (HookContext <String > ctx , Map <String , Object > hints ) {
6064 return Optional .ofNullable (new ImmutableContext ());
6165 }
6266 });
63- client .addHooks (new Hook < Boolean > () {
67+ client .addHooks (new BooleanHook () {
6468 @ Override
6569 public Optional <EvaluationContext > before (HookContext <Boolean > ctx , Map <String , Object > hints ) {
6670 return Optional .ofNullable (new ImmutableContext ());
6771 }
6872 });
69- client .addHooks (new Hook < Integer > () {
73+ client .addHooks (new IntegerHook () {
7074 @ Override
7175 public Optional <EvaluationContext > before (HookContext <Integer > ctx , Map <String , Object > hints ) {
7276 return Optional .ofNullable (new ImmutableContext ());
7377 }
7478 });
75- client .addHooks (new Hook < Double > () {
79+ client .addHooks (new DoubleHook () {
7680 @ Override
7781 public Optional <EvaluationContext > before (HookContext <Double > ctx , Map <String , Object > hints ) {
7882 return Optional .ofNullable (new ImmutableContext ());
0 commit comments