Open
Description
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
}