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 TypeInputResult TypeResult
java.lang.Integer5ClassCastException: Cannot cast java.lang.Integer to java.lang.String
java.lang.StringinputStringjava.lang.StringinputString
nullnull

results matching ""

    No results matching ""