Cast
See javadoc - uk.gov.gchq.koryphe.impl.function.Cast
Available since Koryphe version 1.5.0
Casts input to specified class.
Examples
Cast
Java
JSON
Full JSON
Python
final Cast function = new Cast(String.class);
{
"class" : "Cast",
"outputClass" : "String"
}
{
"class" : "uk.gov.gchq.koryphe.impl.function.Cast",
"outputClass" : "java.lang.String"
}
g.Cast(
output_class="java.lang.String"
)
Input type:
java.lang.Object
Example inputs:
Input Type | Input | Result Type | Result |
---|---|---|---|
java.lang.Integer | 5 | ClassCastException: Cannot cast java.lang.Integer to java.lang.String | |
java.lang.String | inputString | java.lang.String | inputString |
null | null |