OCLOperators oclIsTypeOf
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

oclIsTypeOf( typespec : Class ) : Boolean

Returns true if the type of self is the same as typespec - otherwise, returns false. This operation allows users to check the exact class type of self.

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

Too check if an Object inherits from another type use OCLOperators oclIsKindOf

This page was edited 48 days ago on 02/10/2024. What links here