Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
269dfe4
feat: add hook data support
alexandraoberaigner Sep 23, 2025
3b113c1
feat: gemini suggestions
alexandraoberaigner Sep 23, 2025
5fb278b
feat: hook executor impl (WIP)
alexandraoberaigner Sep 23, 2025
ceedffd
Use shared hook context
guidobrei Sep 23, 2025
2843298
Split HookData interface and implementation
guidobrei Sep 23, 2025
235abba
Atopted tests
guidobrei Sep 23, 2025
e0935f3
Remove obsolete test
guidobrei Sep 23, 2025
dbfcab6
HookSupport improvements: rename back to old name, move code from sta…
alexandraoberaigner Sep 24, 2025
a3ed93e
PR suggestion: use concrete hooks
alexandraoberaigner Sep 24, 2025
3ea9894
PR suggestions: DefaultHookData access modifier, no star imports
alexandraoberaigner Sep 24, 2025
27f3e2a
feat: separate hook support data from logic, PR suggestions
alexandraoberaigner Sep 25, 2025
4ab14bf
Update DefaultHookDataTest.java spotless
alexandraoberaigner Sep 25, 2025
1d8f758
fix tests, spotless apply
alexandraoberaigner Sep 25, 2025
8a9738f
exclude lombok generated functions from codecov
alexandraoberaigner Sep 25, 2025
b6cd0e2
replace init function with setters
alexandraoberaigner Sep 29, 2025
1a7e5af
pr suggestion: replace Generated annotation with more descriptive Exc…
alexandraoberaigner Sep 30, 2025
7fe0675
PR suggestion: make HookSupportData a real POJO
alexandraoberaigner Sep 30, 2025
92b6dc4
gemini suggestions
alexandraoberaigner Sep 30, 2025
0e897f2
PR suggestion: call hooks as early as possible
alexandraoberaigner Sep 30, 2025
8b6aba9
PR suggestions: integration test hook data usage in client, set pair …
alexandraoberaigner Oct 2, 2025
3417827
add hook data spec test
alexandraoberaigner Oct 2, 2025
db6cc86
Merge branch 'main' into feat/hook-data-support
alexandraoberaigner Oct 2, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 39 additions & 0 deletions src/main/java/dev/openfeature/sdk/DefaultHookData.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
package dev.openfeature.sdk;

import java.util.HashMap;
import java.util.Map;

/**
* Default implementation of HookData.
*/
public class DefaultHookData implements HookData {
private Map<String, Object> data;

@Override
public void set(String key, Object value) {
if (data == null) {
data = new HashMap<>();
}
data.put(key, value);
}

@Override
public Object get(String key) {
if (data == null) {
return null;
}
return data.get(key);
}

@Override
public <T> T get(String key, Class<T> type) {
Object value = get(key);
if (value == null) {
return null;
}
if (!type.isInstance(value)) {
throw new ClassCastException("Value for key '" + key + "' is not of type " + type.getName());
}
return type.cast(value);
}
}
Loading
Loading