Uploaded image for project: 'ONOS'
  1. ONOS
  2. ONOS-4582

Enum file constructor has problems when the attribute name has hyphen in it.

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Minor
    • Resolution: Done
    • Affects Version/s: 1.6.0
    • Fix Version/s: 1.6.0
    • Component/s: None
    • Labels:
    • Environment:

      ONOS

    • Story Points:
      3

      Description

      1) Hyphen at all places must be made underscore in enum attribute.

      2) Constructor of enum class must have the same name as enum attribute defined in java file.

      public enum OperStatusEnum {

      /**

      • Represents up.
        */
        UP(1),

      /**

      • Represents down.
        */
        DOWN(2),

      /**

      • Represents testing.
        */
        TESTING(3),

      /**

      • Represents unknown.
        */
        UNKNOWN(4),

      /**

      • Represents dormant.
        */
        DORMANT(5),

      /**

      • Represents notPresent.
        */
        NOTPRESENT(6),

      /**

      • Represents lowerLayerDown.
        */
        LOWERLAYER_DOWN(7);

      private int operStatusEnum;

      /**

      • Creates an instance of operStatusEnum.
        *
      • @param value value of operStatusEnum
        */
        OperStatusEnum(int value) { operStatusEnum = value; }

        public static OperStatusEnum of(int value)

        Unknown macro: { switch (value) { case 1: return OperStatusEnum.UP; case 2: return OperStatusEnum.DOWN; case 3: return OperStatusEnum.TESTING; case 4: return OperStatusEnum.UNKNOWN; case 5: return OperStatusEnum.DORMANT; case 6: return OperStatusEnum.NOT-PRESENT; case 7: return OperStatusEnum.LOWER-LAYER-DOWN; default : return null; } }

        Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

            • Assignee:
              janani Janani B
              Reporter:
              janani Janani B
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: