CallMethod
See javadoc - uk.gov.gchq.koryphe.impl.function.CallMethod
Available since Koryphe version 1.4.0
Allows you to call any public no-argument method on an object
Examples
Call to string
Java
JSON
Full JSON
Python
final CallMethod function = new CallMethod("toString");
{
"class" : "CallMethod",
"method" : "toString"
}
{
"class" : "uk.gov.gchq.koryphe.impl.function.CallMethod",
"method" : "toString"
}
g.CallMethod(
method="toString"
)
Input type:
java.lang.Object
Example inputs:
Input Type | Input | Result Type | Result |
---|---|---|---|
java.lang.String | a string | java.lang.String | a string |
java.lang.Integer | 1 | java.lang.String | 1 |
java.util.HashSet | [item2, item1] | java.lang.String | [item2, item1] |
null | null |
Call to lower case
Java
JSON
Full JSON
Python
final CallMethod function = new CallMethod("toLowerCase");
{
"class" : "CallMethod",
"method" : "toLowerCase"
}
{
"class" : "uk.gov.gchq.koryphe.impl.function.CallMethod",
"method" : "toLowerCase"
}
g.CallMethod(
method="toLowerCase"
)
Input type:
java.lang.Object
Example inputs:
Input Type | Input | Result Type | Result |
---|---|---|---|
java.lang.String | STRING1 | java.lang.String | string1 |
java.lang.String | String2 | java.lang.String | string2 |
java.lang.Integer | 10 | RuntimeException: Unable to invoke toLowerCase on object class class java.lang.Integer | |
null | null |