MDrivenWiki
Log in

OCLOperators oclIsKindOf

From MDrivenWiki

oclIsKindOf( typespec : Class ) : Boolean

Returns true if the type of self corresponds to the type or supertype of typespec, false otherwise. This operation allows users to check the class hierarchy of self much like would an instanceof Java.

Expression Result
anEmployee.oclIsKindOf(Employee) true
anEmployee.oclIsKindOf(Person) true
aCat.oclIsKindOf(Person) false