org.apache.commons.lang.enum
Class EnumUtils

java.lang.Object
  extended byorg.apache.commons.lang.enum.EnumUtils

Deprecated. Replaced by org.apache.commons.lang.enums.EnumUtils and will be removed in version 3.0. All classes in this package are deprecated and repackaged to org.apache.commons.lang.enums since enum is a Java 1.5 keyword.

public class EnumUtils
extends Object

Utility class for accessing and manipulating Enums.

Since:
1.0
Version:
$Id: EnumUtils.java 161243 2005-04-14 04:30:28Z ggregory $
Author:
Stephen Colebourne, Gary Gregory
See Also:
EnumUtils, Enum, ValuedEnum

Constructor Summary
EnumUtils()
          Deprecated. Public constructor.
 
Method Summary
static ValuedEnum getEnum(Class enumClass, int value)
          Deprecated. Gets a ValuedEnum object by class and value.
static Enum getEnum(Class enumClass, String name)
          Deprecated. Gets an Enum object by class and name.
static List getEnumList(Class enumClass)
          Deprecated. Gets the List of Enum objects using the Enum class.
static Map getEnumMap(Class enumClass)
          Deprecated. Gets the Map of Enum objects by name using the Enum class.
static Iterator iterator(Class enumClass)
          Deprecated. Gets an Iterator over the Enum objects in an Enum class.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EnumUtils

public EnumUtils()
Deprecated. 
Public constructor. This class should not normally be instantiated.

Since:
2.0
Method Detail

getEnum

public static Enum getEnum(Class enumClass,
                           String name)
Deprecated. 

Gets an Enum object by class and name.

Parameters:
enumClass - the class of the Enum to get
name - the name of the Enum to get, may be null
Returns:
the enum object
Throws:
IllegalArgumentException - if the enum class is null

getEnum

public static ValuedEnum getEnum(Class enumClass,
                                 int value)
Deprecated. 

Gets a ValuedEnum object by class and value.

Parameters:
enumClass - the class of the Enum to get
value - the value of the Enum to get
Returns:
the enum object, or null if the enum does not exist
Throws:
IllegalArgumentException - if the enum class is null

getEnumMap

public static Map getEnumMap(Class enumClass)
Deprecated. 

Gets the Map of Enum objects by name using the Enum class.

If the requested class has no enum objects an empty Map is returned. The Map is unmodifiable.

Parameters:
enumClass - the class of the Enum to get
Returns:
the enum object Map
Throws:
IllegalArgumentException - if the enum class is null
IllegalArgumentException - if the enum class is not a subclass of Enum

getEnumList

public static List getEnumList(Class enumClass)
Deprecated. 

Gets the List of Enum objects using the Enum class.

The list is in the order that the objects were created (source code order).

If the requested class has no enum objects an empty List is returned. The List is unmodifiable.

Parameters:
enumClass - the class of the Enum to get
Returns:
the enum object Map
Throws:
IllegalArgumentException - if the enum class is null
IllegalArgumentException - if the enum class is not a subclass of Enum

iterator

public static Iterator iterator(Class enumClass)
Deprecated. 

Gets an Iterator over the Enum objects in an Enum class.

The iterator is in the order that the objects were created (source code order).

If the requested class has no enum objects an empty Iterator is returned. The Iterator is unmodifiable.

Parameters:
enumClass - the class of the Enum to get
Returns:
an Iterator of the Enum objects
Throws:
IllegalArgumentException - if the enum class is null
IllegalArgumentException - if the enum class is not a subclass of Enum


Copyright © 2001-2005 The Apache Software Foundation. All Rights Reserved.