/
Type Comparison Functions(3.0)
Type Comparison Functions(3.0)
instanceOf
Returns true
if the value is of the specified type.
boolean instanceOf ( any myValue , any myType )
Parameter | Description |
---|---|
| The value to evaluate. Can be of any type, even primitive types. |
| Any type to evaluate against |
Returns |
|
Example - Using instanceOf
consume{ if ( instanceOf( input, module1.type1 ) ) { udrRoute( ( module1.type1 )input, "link_1" ); } else if ( instanceOf( input, module2.type2 ) ) { udrRoute( ( module2.type2 )input, "link_2" ); } else { // handle error case } }
You can use variables of the types list and map in myValue
, but the the contained types are not tested. In order to avoid confusion, it is recommended to always use any as a contained type in the myType
argument.