<!-- 
RSS generated by JIRA (8.20.10#820010-sha1:ace47f9899e9ee25d7157d59aa17ab06aee30d3d) at Wed Feb 07 20:08:35 UTC 2024

It is possible to restrict the fields that are returned in this document by specifying the 'field' parameter in your request.
For example, to request only the issue key and summary append 'field=key&field=summary' to the URL of your request.
-->
<rss version="0.92" >
<channel>
    <title>OpenDaylight JIRA</title>
    <link>https://jira.opendaylight.org</link>
    <description>This file is an XML representation of an issue</description>
    <language>en-us</language>    <build-info>
        <version>8.20.10</version>
        <build-number>820010</build-number>
        <build-date>22-06-2022</build-date>
    </build-info>


<item>
            <title>[MDSAL-76] Generated Java Enumerations should contain mapping to the string counter part</title>
                <link>https://jira.opendaylight.org/browse/MDSAL-76</link>
                <project id="10137" key="MDSAL">mdsal</project>
                    <description>&lt;p&gt;The ask:&lt;/p&gt;

&lt;p&gt;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).&lt;/p&gt;

&lt;p&gt;Specifically, if we have a type definition like this:&lt;/p&gt;

&lt;p&gt;        leaf testEnum {&lt;br/&gt;
          type enumeration &lt;/p&gt;
{
             enum &quot;value-one&quot;;  
             enum &quot;value-two&quot;;       
          }

&lt;p&gt;        }&lt;/p&gt;

&lt;p&gt;today it generates an inner enumeration class like this:&lt;/p&gt;

&lt;p&gt;    public enum TestEnum &lt;/p&gt;
{
        ValueOne(0),
        ValueTwo(1)
        ;
    
    
       ...
    }

&lt;p&gt;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:&lt;/p&gt;

&lt;p&gt;  public enum TestEnum {&lt;br/&gt;
        ValueOne(0, &quot;value-one&quot;),&lt;br/&gt;
        ValueTwo(1, &quot;value-two&quot;)&lt;br/&gt;
        ;&lt;/p&gt;

&lt;p&gt;        String getName()&lt;/p&gt;
{ ... }&lt;br/&gt;
&lt;br/&gt;
        static TestEnum forValue( String name ){ ... }
&lt;p&gt;       ...&lt;br/&gt;
    }&lt;/p&gt;

&lt;p&gt;. 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 &quot;value&quot;.&lt;/p&gt;</description>
                <environment>&lt;p&gt;Operating System: All&lt;br/&gt;
Platform: All&lt;/p&gt;</environment>
        <key id="26898">MDSAL-76</key>
            <summary>Generated Java Enumerations should contain mapping to the string counter part</summary>
                <type id="10100" iconUrl="https://jira.opendaylight.org/secure/viewavatar?size=xsmall&amp;avatarId=10310&amp;avatarType=issuetype">Improvement</type>
                                                <status id="5" iconUrl="https://jira.opendaylight.org/images/icons/statuses/resolved.png" description="A resolution has been taken, and it is awaiting verification by reporter. From here issues are either reopened, or are closed.">Resolved</status>
                    <statusCategory id="3" key="done" colorName="green"/>
                                    <resolution id="10000">Done</resolution>
                                        <assignee username="rgoulding">Ryan Goulding</assignee>
                                    <reporter username="devin.avery@brocade.com">Devin Avery</reporter>
                        <labels>
                    </labels>
                <created>Thu, 19 Mar 2015 12:16:52 +0000</created>
                <updated>Fri, 9 Mar 2018 18:00:06 +0000</updated>
                            <resolved>Fri, 10 Mar 2017 11:56:47 +0000</resolved>
                                                                        <due></due>
                            <votes>0</votes>
                                    <watches>3</watches>
                                                                                                                <comments>
                            <comment id="54097" author="rovarga" created="Thu, 19 Mar 2015 21:54:36 +0000"  >&lt;p&gt;This is a change to the bindings specification, although compatible. Targetting to next release as we are just a few hours from API freeze.&lt;/p&gt;</comment>
                            <comment id="54098" author="rgoulding" created="Wed, 1 Jun 2016 13:40:38 +0000"  >&lt;p&gt;It looks like this is already part of the binding spec;  am I missing something:&lt;br/&gt;
&lt;a href=&quot;https://github.com/opendaylight/mdsal/blob/master/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/yangtools/sal/binding/model/api/Enumeration.java&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/opendaylight/mdsal/blob/master/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/yangtools/sal/binding/model/api/Enumeration.java&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="54099" author="rgoulding" created="Wed, 1 Jun 2016 20:30:29 +0000"  >&lt;p&gt;Nevermind a quick test proved otherwise.  This will require exposing the &quot;raw&quot; data from yangtools and then outputting in mdsal binding generator.  I have a draft change in the works that appears to work.&lt;/p&gt;</comment>
                            <comment id="54100" author="rovarga" created="Mon, 20 Jun 2016 10:30:46 +0000"  >&lt;p&gt;&lt;a href=&quot;https://git.opendaylight.org/gerrit/39733&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://git.opendaylight.org/gerrit/39733&lt;/a&gt;&lt;br/&gt;
&lt;a href=&quot;https://git.opendaylight.org/gerrit/39734&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://git.opendaylight.org/gerrit/39734&lt;/a&gt;&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10000">
                    <name>Blocks</name>
                                                                <inwardlinks description="is blocked by">
                                        <issuelink>
            <issuekey id="26862">MDSAL-40</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </issuelinktype>
                    </issuelinks>
                <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                                            <customfield id="customfield_11400" key="com.atlassian.jira.plugins.jira-development-integration-plugin:devsummary">
                        <customfieldname>Development</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                        <customfield id="customfield_10208" key="com.atlassian.jira.plugin.system.customfieldtypes:textfield">
                        <customfieldname>External issue ID</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2872</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10201" key="com.atlassian.jira.plugin.system.customfieldtypes:url">
                        <customfieldname>External issue URL</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue><![CDATA[https://bugs.opendaylight.org/show_bug.cgi?id=2872]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                            <customfield id="customfield_10206" key="com.atlassian.jira.plugin.system.customfieldtypes:select">
                        <customfieldname>Issue Type</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="10305"><![CDATA[Improvement]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                        <customfield id="customfield_10204" key="com.atlassian.jira.plugin.system.customfieldtypes:select">
                        <customfieldname>ODL SR Target Milestone</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="10310"><![CDATA[Boron-M5]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                    <customfield id="customfield_10000" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>0|i02w5z:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                </customfields>
    </item>
</channel>
</rss>