🚀 Welcome to MDriven Learn –  Don’t miss the latest Release Notes.
OCLOperators superTypes


Returns a set of all the direct supertypes of the type.

ReturnType:

Collection(System.String)

Example:

Example showing OCL operator superTypes
Mango.superTypes

Returns

['Fruit']


It's like asking, "Who are my parents?" for any class you have.

The superTypes operator only returns the first level of inheritance (direct parents), not the complete inheritance hierarchy. For all ancestors, use allSuperTypes instead.

See also: