bump version to 1.8.3 in pom.xml and add getValues method to AgentContext for improved value retrieval

This commit is contained in:
extio-de
2025-10-31 16:33:42 +01:00
parent bd37a143f6
commit ae322743d6
2 changed files with 9 additions and 1 deletions

View File

@@ -119,6 +119,14 @@ public final class AgentContext {
}
throw new IllegalArgumentException("Value for key '" + key + "' is not of type " + type.getName());
}
public <T> List<T> getValues(final String key, final Class<T> type) {
final var values = this.context.get(key);
if (values == null) {
return null;
}
return values.stream().map(type::cast).collect(Collectors.toCollection(ArrayList::new));
}
public <T> void setValue(final String key, final T value) {
if (value == null) {