Bug 2872: Generated Java Enumerations should contain mapping to the string counter...
authorRyan Goulding <ryandgoulding@gmail.com>
Thu, 2 Jun 2016 18:01:19 +0000 (14:01 -0400)
committerAnil Belur <abelur@linuxfoundation.org>
Wed, 19 Jun 2024 00:41:19 +0000 (10:41 +1000)
commit481e4d14dd8347da64321447fecf6c89cd6b2f55
tree78e264aefec02c19b5933be42e5bc33502ac8725
parentaff43e270d829c04590b459568575683acd1eafc
Bug 2872: Generated Java Enumerations should contain mapping to the string counter part

Changes the Enumeration API to expose the "getMappedName()" accessor, which exposes
the name that is used for the Java mapped enum name.  The EnumTemplate.xtend template
was modified in the following way:

1) A field was added to track the "raw" enum name, the one parsed from the YANG file.
2) The constructor was modified to accept the raw enum name as a parameter, and store
the parameter value in the name instance variable.
3) An accessor was added called "getName()", which exposes the name instance variable.

A corresponding change in yangtools changes the EnumEffectiveStatementImpl.getName()
definition to expose the "raw" name attribute parsed from the yang file:

https://git.opendaylight.org/gerrit/#/c/39733/

Change-Id: If248039a2b10958ff563ee0799d7b13284570b3c
Signed-off-by: Ryan Goulding <ryandgoulding@gmail.com>
binding/mdsal-binding-java-api-generator/src/main/java/org/opendaylight/yangtools/sal/java/api/generator/EnumTemplate.xtend