ToInteger

See javadoc - uk.gov.gchq.koryphe.impl.function.ToInteger

Available since Koryphe version 1.5.0

Returns any input as Integer.

Examples

To integer

Java
JSON
Full JSON
Python
final ToInteger function = new ToInteger();
{
  "class" : "ToInteger"
}
{
  "class" : "uk.gov.gchq.koryphe.impl.function.ToInteger"
}
g.ToInteger()

Input type:

java.lang.Object

Example inputs:

Input TypeInputResult TypeResult
java.lang.Integer4java.lang.Integer4
java.lang.Long5java.lang.Integer5
java.lang.String5java.lang.Integer5
java.lang.StringaStringNumberFormatException: For input string: "aString"
java.util.Arrays$ArrayList[6, 3]IllegalArgumentException: Could not convert value to Integer: [6, 3]
nullnull

results matching ""

    No results matching ""