DictionaryLookup
See javadoc - uk.gov.gchq.koryphe.impl.function.DictionaryLookup
Available since Koryphe version 1.7.0
looks up a value in a Map
Examples
Dictionary lookup example
Java
JSON
Full JSON
Python
final DictionaryLookup<Integer, String> dictionaryLookup = new DictionaryLookup<>(map);
{
"class" : "DictionaryLookup",
"dictionary" : {
"1" : "one",
"2" : "two",
"3" : "three"
}
}
{
"class" : "uk.gov.gchq.koryphe.impl.function.DictionaryLookup",
"dictionary" : {
"1" : "one",
"2" : "two",
"3" : "three"
}
}
g.DictionaryLookup(
dictionary={'1': 'one', '2': 'two', '3': 'three'}
)
Input type:
java.lang.Object
Example inputs:
Input Type | Input | Result Type | Result |
---|---|---|---|
java.lang.Integer | 1 | java.lang.String | one |
null | null | ||
java.lang.Integer | 4 | null | |
java.lang.Long | 2 | null |