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

Module Management - Part 1 - getModule() Pattern

Creating Items in Sparx EA via Java

Java and Enterprise Architect from Sparx Systems – Getting Started