<!-- 
RSS generated by JIRA (8.20.10#820010-sha1:ace47f9899e9ee25d7157d59aa17ab06aee30d3d) at Wed Feb 07 20:10:53 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-754] Generate ofName() and ofValue() for enumerations</title>
                <link>https://jira.opendaylight.org/browse/MDSAL-754</link>
                <project id="10137" key="MDSAL">mdsal</project>
                    <description>&lt;p&gt;For each enumeration we currently generate following methods:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;
        /**
         * Return the enumeration member whose {@link #getName()} matches specified value.
         *
         * @param name YANG assigned name
         * @&lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; corresponding Simple item, &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; present
         * @&lt;span class=&quot;code-keyword&quot;&gt;throws&lt;/span&gt; NullPointerException &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; name is &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;
         */
        &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;static&lt;/span&gt; Optional&amp;lt;Simple&amp;gt; forName(&lt;span class=&quot;code-object&quot;&gt;String&lt;/span&gt; name) {
            &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; Optional.ofNullable(NAME_MAP.get(Objects.requireNonNull(name)));
        }

        /**
         * Return the enumeration member whose {@link #getIntValue()} matches specified value.
         *
         * @param intValue integer value
         * @&lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; corresponding Simple item, or &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; no such item exists
         */
        &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;static&lt;/span&gt; Simple forValue(&lt;span class=&quot;code-object&quot;&gt;int&lt;/span&gt; intValue) {
            &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; VALUE_MAP.get(intValue);
        }
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;This is quite inconsistent: we use Optional for the former and a nullable (unmarked) return for the latter. Fix this up by using properly-marked nullable return in forName().&lt;br/&gt;
Also introduce non-null-returning counterparts, ofName() and ofValue(), which throw an IllegalArgumentException:&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;
        &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;static&lt;/span&gt; @NonNull Simple ofName(&lt;span class=&quot;code-object&quot;&gt;String&lt;/span&gt; name) {
            &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; CodeHelpers.checkEnum(forName(name), name);
        }

        &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;static&lt;/span&gt; @NonNull Simple ofValue(&lt;span class=&quot;code-object&quot;&gt;int&lt;/span&gt; intValue) {
            &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; CodeHelpers.checkEnum(forValue(intValue), intValue);
        }
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</description>
                <environment></environment>
        <key id="35713">MDSAL-754</key>
            <summary>Generate ofName() and ofValue() for enumerations</summary>
                <type id="10100" iconUrl="https://jira.opendaylight.org/secure/viewavatar?size=xsmall&amp;avatarId=10310&amp;avatarType=issuetype">Improvement</type>
                                            <priority id="3" iconUrl="https://jira.opendaylight.org/images/icons/priorities/major.svg">Medium</priority>
                        <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="rovarga">Robert Varga</assignee>
                                    <reporter username="rovarga">Robert Varga</reporter>
                        <labels>
                    </labels>
                <created>Sat, 23 Apr 2022 13:44:26 +0000</created>
                <updated>Tue, 26 Apr 2022 15:46:58 +0000</updated>
                            <resolved>Tue, 26 Apr 2022 15:46:58 +0000</resolved>
                                                    <fixVersion>10.0.0</fixVersion>
                                    <component>Binding codegen</component>
                        <due></due>
                            <votes>0</votes>
                                    <watches>1</watches>
                                                                                                                    <issuelinks>
                            <issuelinktype id="10003">
                    <name>Relates</name>
                                                                <inwardlinks description="relates to">
                                        <issuelink>
            <issuekey id="35712">MDSAL-753</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_10000" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>0|i0427z:</customfieldvalue>

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