Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-6234270

Class Enum needs a function like Enum<E> getEnumFor(int)

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Not an Issue
    • Icon: P4 P4
    • None
    • 6
    • core-libs
    • x86
    • windows_xp

      A DESCRIPTION OF THE REQUEST :
       
      one needs a function that can translate from a <int> into the particular enum value...


      JUSTIFICATION :
      when one is developing one the wire protocols... one needs to be able to translate from a one the wire <int> back to a enum value... currently the only way to do that is to have
      a switch statement

      switch( aValue )
        {
         case 0:
             {
             theENUM = ENUM_0;
              break;
             }// end case 0

      one has to do that for every Enum which makes them hard to work with...
      ###@###.### 2005-03-01 11:53:22 GMT

            Unassigned Unassigned
            ndcosta Nelson Dcosta (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: