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

The CFC instance or Java object that you are testing

Alias: value

type
string, required

The name of the interface, component, or Java class of which the object might be an instance.

Examples

writeDump(isInstanceOf({},"java.util.Map")); // true
writeDump(isInstanceOf("Lucee","java.util.Map")); // false
writeDump(isInstanceOf("Lucee","java.lang.String")); // true

See also