(enum) java.lang.Enum should have a values(Class<T>) method.

XMLWordPrintable

    • Type: Enhancement
    • Resolution: Won't Fix
    • Priority: P5
    • None
    • Affects Version/s: 6
    • Component/s: core-libs
    • x86
    • windows_2000

      A DESCRIPTION OF THE REQUEST :
      java.lang.Enum should have a static method values(Class<T>).
      The signature of the method would be that:

      public static <T extends Enum<T>> T[] values(Class<T> enumType);

      JUSTIFICATION :
      Every enum class has a static method valueOf(String) which the compiler generates in subclasses. The java.lang.Enum has the static method valueOf(Class<T>, String) which is a "companion" of the valueOf(String). The method valueOf(Class<T>, String) is very helpful in enum-based data structures.

      However, the values() method doesn't have a "companion" in java.lang.Enum. This makes a defficiency when working in enum-based data structures which the method values(Class<T>) could easily supply.

            Assignee:
            Joe Darcy
            Reporter:
            Nelson Dcosta (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: