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 TypeInputResult TypeResult
java.lang.Stringa stringjava.lang.Stringa string
java.lang.Integer1java.lang.String1
java.util.HashSet[item2, item1]java.lang.String[item2, item1]
nullnull

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 TypeInputResult TypeResult
java.lang.StringSTRING1java.lang.Stringstring1
java.lang.StringString2java.lang.Stringstring2
java.lang.Integer10RuntimeException: Unable to invoke toLowerCase on object class class java.lang.Integer
nullnull

results matching ""

    No results matching ""