IsA

See javadoc - uk.gov.gchq.koryphe.impl.predicate.IsA

Available since Koryphe version 1.0.0

Checks if an input is an instance of a class

Examples

Is a string

Java
JSON
Full JSON
Python
final IsA function = new IsA(String.class);
{
  "class" : "IsA",
  "type" : "java.lang.String"
}
{
  "class" : "uk.gov.gchq.koryphe.impl.predicate.IsA",
  "type" : "java.lang.String"
}
g.IsA( 
  type="java.lang.String" 
)

Input type:

java.lang.Object

Example inputs:

Input TypeInputResult
java.lang.Integer1false
java.lang.Double2.5false
java.lang.Stringabctrue

Is a number

Java
JSON
Full JSON
Python
final IsA function = new IsA(Number.class);
{
  "class" : "IsA",
  "type" : "java.lang.Number"
}
{
  "class" : "uk.gov.gchq.koryphe.impl.predicate.IsA",
  "type" : "java.lang.Number"
}
g.IsA( 
  type="java.lang.Number" 
)

Input type:

java.lang.Object

Example inputs:

Input TypeInputResult
java.lang.Integer1true
java.lang.Double2.5true
java.lang.Stringabcfalse

results matching ""

    No results matching ""