Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.2
    • Fix Version/s: 3.0
    • Component/s: lang.*
    • Labels:
      None

      Description

      Below is an EnumUtils for JDK 1.5. It's also found in the enums.EnumUtils javadoc:

      import java.util.*;

      public class EnumUtils {

      public static Enum getEnum(Class enumClass, String token)

      { return Enum.valueOf(enumClass, token); }

      public static Map getEnumMap(Class enumClass) {
      HashMap map = new HashMap();
      Iterator itr = EnumUtils.iterator(enumClass);
      while(itr.hasNext())

      { Enum enm = (Enum) itr.next(); map.put( enm.name(), enm ); }

      return map;
      }

      public static List getEnumList(Class enumClass)

      { return new ArrayList( EnumSet.allOf(enumClass) ); }

      public static Iterator iterator(Class enumClass)

      { return EnumUtils.getEnumList(enumClass).iterator(); }

      }

        Activity

        Mark Thomas made changes -
        Workflow jira [ 12387669 ] Default workflow, editable Closed status [ 12602593 ]
        Henri Yandell made changes -
        Component/s lang.* [ 12313203 ]
        Stephen Colebourne made changes -
        Status Reopened [ 4 ] Closed [ 6 ]
        Resolution Fixed [ 1 ]
        Stephen Colebourne made changes -
        Resolution Fixed [ 1 ]
        Status Closed [ 6 ] Reopened [ 4 ]
        Henri Yandell made changes -
        Resolution Fixed [ 1 ]
        Status Reopened [ 4 ] Closed [ 6 ]
        Henri Yandell made changes -
        Resolution Won't Fix [ 2 ]
        Status Closed [ 6 ] Reopened [ 4 ]
        Henri Yandell made changes -
        Status Open [ 1 ] Closed [ 6 ]
        Resolution Won't Fix [ 2 ]
        Henri Yandell made changes -
        Field Original Value New Value
        Fix Version/s LangTwo 1.0 [ 12312130 ]
        Fix Version/s 3.0 [ 12311714 ]
        Henri Yandell created issue -

          People

          • Assignee:
            Unassigned
            Reporter:
            Henri Yandell
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development