Return Enumerated Type Pattern

Similarly to the Return Wrapped Object Pattern, this one involves reading the EA value for an enumerated attribute value and returning a corresponding object.

get objectType() {
    return ObjectType.fromCode(
        this.wrappedObject.ObjectType
    );
}

The code stored by the native attribute ObjectType is decoded by the ObjectType enumerated type, and the enumerated value object is returned.

Comments

Popular posts from this blog

Creating Items in Sparx EA via Java

Module Management - Part 1 - getModule() Pattern

Traversing a EA Model via Java