Return-Path: Delivered-To: apmail-commons-issues-archive@minotaur.apache.org Received: (qmail 40544 invoked from network); 1 Nov 2009 15:32:23 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 1 Nov 2009 15:32:23 -0000 Received: (qmail 84888 invoked by uid 500); 1 Nov 2009 15:32:22 -0000 Delivered-To: apmail-commons-issues-archive@commons.apache.org Received: (qmail 84758 invoked by uid 500); 1 Nov 2009 15:32:22 -0000 Mailing-List: contact issues-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: issues@commons.apache.org Delivered-To: mailing list issues@commons.apache.org Received: (qmail 84748 invoked by uid 99); 1 Nov 2009 15:32:22 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 01 Nov 2009 15:32:22 +0000 X-ASF-Spam-Status: No, hits=-10.5 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 01 Nov 2009 15:32:19 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 73551234C1F2 for ; Sun, 1 Nov 2009 07:31:59 -0800 (PST) Message-ID: <2005057963.1257089519457.JavaMail.jira@brutus> Date: Sun, 1 Nov 2009 15:31:59 +0000 (UTC) From: "Stephen Colebourne (JIRA)" To: issues@commons.apache.org Subject: [jira] Closed: (LANG-290) EnumUtils for JDK 5.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/LANG-290?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Stephen Colebourne closed LANG-290. ----------------------------------- Resolution: Fixed Renamed isEnum to isValidEnum. Don't believe that sizeOf is sufficiently commonly needed, and is easy to access by getting the list/array and calling size/length. > EnumUtils for JDK 5.0 > --------------------- > > Key: LANG-290 > URL: https://issues.apache.org/jira/browse/LANG-290 > Project: Commons Lang > Issue Type: Improvement > Affects Versions: 2.2 > Reporter: Henri Yandell > Fix For: 3.0 > > > 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(); > } > } -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.