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 Type | Input | Result |
---|---|---|
java.lang.Integer | 1 | false |
java.lang.Double | 2.5 | false |
java.lang.String | abc | true |
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 Type | Input | Result |
---|---|---|
java.lang.Integer | 1 | true |
java.lang.Double | 2.5 | true |
java.lang.String | abc | false |