Skip to content

Commit 16fbcd4

Browse files
committed
Add extra helper function
1 parent 19c5b23 commit 16fbcd4

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

  • src/main/java/eu/openanalytics/containerproxy/model/runtime

src/main/java/eu/openanalytics/containerproxy/model/runtime/Proxy.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,15 @@ public <T> T getRuntimeObject(RuntimeValueKey<T> key) {
194194
return runtimeValue.getObject();
195195
}
196196

197+
public <T> T getRuntimeObjectOrNull(RuntimeValueKey<T> key) {
198+
Objects.requireNonNull(key, "key may not be null");
199+
RuntimeValue runtimeValue = runtimeValues.get(key);
200+
if (runtimeValue == null) {
201+
return null;
202+
}
203+
return runtimeValue.getObject();
204+
}
205+
197206
public <T> String getRuntimeValue(RuntimeValueKey<T> key) {
198207
Objects.requireNonNull(key, "key may not be null");
199208
RuntimeValue runtimeValue = runtimeValues.get(key);

0 commit comments

Comments
 (0)