ToLong
See javadoc - uk.gov.gchq.koryphe.impl.function.ToLong
Available since Koryphe version 1.5.0
Returns any input as Long.
Examples
To long
Java
JSON
Full JSON
Python
final ToLong function = new ToLong();{
"class" : "ToLong"
}{
"class" : "uk.gov.gchq.koryphe.impl.function.ToLong"
}g.ToLong()Input type:
java.lang.Object
Example inputs:
| Input Type | Input | Result Type | Result |
|---|---|---|---|
| java.lang.Integer | 4 | java.lang.Long | 4 |
| java.lang.Long | 5 | java.lang.Long | 5 |
| java.lang.String | 5 | java.lang.Long | 5 |
| java.lang.String | aString | NumberFormatException: For input string: "aString" | |
| java.util.Arrays$ArrayList | [6, 3] | IllegalArgumentException: Could not convert value to Long: [6, 3] | |
| null | null |