-
Improvement
-
Resolution: Done
-
None
-
None
-
None
-
None
-
Operating System: All
Platform: All
The ask:
As a developer, I want the string value for a given enumeration to be accessible from the generated java binding type, so I can use the raw string value as needed (for example to pass to a southbound plugin).
Specifically, if we have a type definition like this:
leaf testEnum {
type enumeration
}
today it generates an inner enumeration class like this:
public enum TestEnum
{ ValueOne(0), ValueTwo(1) ; ... }What would be great as it would drastically simplify things, would be for the string value to also be included, and accessible from the generated class. For example, the above type would generate:
public enum TestEnum {
ValueOne(0, "value-one"),
ValueTwo(1, "value-two")
;
String getName()
{ ... }static TestEnum forValue( String name ){ ... }
...
}
. Today the only way to get the mapping is to get the schema context for the module, drill down to the specific definition for the enum, and then manually create a map between the enumPair schema definition and the TestEnum class via the "value".
- is blocked by
-
MDSAL-40 Milestone: Implement Binding Specification v2
- Resolved