Skip to content
Snippets Groups Projects
Commit de3ed8f1 authored by Johannes Mey's avatar Johannes Mey
Browse files

add value accessor for mapping

parent 130a96ef
No related branches found
No related tags found
No related merge requests found
...@@ -14,4 +14,13 @@ aspect Helpers { ...@@ -14,4 +14,13 @@ aspect Helpers {
public void MappingElement.addKeyValuePair(String key, Element value) { public void MappingElement.addKeyValuePair(String key, Element value) {
addKeyValuePair(new KeyValuePair(key, value)); addKeyValuePair(new KeyValuePair(key, value));
} }
public java.util.Optional<Element> MappingElement.getValue(String key) {
for (KeyValuePair pair : getKeyValuePairList()) {
if (pair.getKey().equals(key)) {
return java.util.Optional.of(pair.getValue());
}
}
return java.util.Optional.empty();
}
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment