Skip to content

Add enumerations support for JSObjects #53

Open
@ccadete

Description

@ccadete

When a JSObject interface method returns an enumeration of values, could they be translated directly to an enum, instead of an int or string?
First example: If the enumeration implements an interface the value could be retrieved, example:

public enum State implements JSEnum<String> {
    OPEN("open"),
    CLOSE("close")

    // ...

    @Override
    public String getValue(){
        ....
    }
}

Second example: Using custom annotation on the enum field:

public enum State implements JSObject {
    @JSEnumString("open")
    OPEN,

    @JSEnumString("close")
    CLOSE
}

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions