IsInstanceOf()
Determines whether an object is an instance of a Lucee interface or component, or of a Java class.
IsInstanceOf( obj=any, type=string );
Returns: Boolean
| Argument | Description |
|---|---|
|
obj
any,
required
|
edit
The CFC instance or Java object that you are testing Alias: value |
|
type
string,
required
|
edit
The name of the interface, component, or Java class of which the object might be an instance. |
Examples
editwriteDump(isInstanceOf({},"java.util.Map")); // true
writeDump(isInstanceOf("Lucee","java.util.Map")); // false
writeDump(isInstanceOf("Lucee","java.lang.String")); // true
See also
- Components (CFCs)
- Decision logic
- Java
- Data Types in Lucee
- Search Issue Tracker open_in_new
- Search Lucee Test Cases open_in_new (good for further, detailed examples)