Class EnumUtils
- java.lang.Object
 - 
- org.apache.commons.lang.enums.EnumUtils
 
 
- 
@Deprecated(since="2021-04-30") public class EnumUtils extends java.lang.ObjectDeprecated.Commons Lang 2 is in maintenance mode. Commons Lang 3 should be used instead.Utility class for accessing and manipulating
Enums.- Since:
 - 2.1 (class existed in enum package from v1.0)
 - See Also:
 Enum,ValuedEnum
 
- 
- 
Constructor Summary
Constructors Constructor Description EnumUtils()Deprecated.Public constructor. 
- 
Method Summary
All Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static ValuedEnumgetEnum(java.lang.Class enumClass, int value)Deprecated.Gets aValuedEnumobject by class and value.static EnumgetEnum(java.lang.Class enumClass, java.lang.String name)Deprecated.Gets anEnumobject by class and name.static java.util.ListgetEnumList(java.lang.Class enumClass)Deprecated.Gets theListofEnumobjects using theEnumclass.static java.util.MapgetEnumMap(java.lang.Class enumClass)Deprecated.Gets theMapofEnumobjects by name using theEnumclass.static java.util.Iteratoriterator(java.lang.Class enumClass)Deprecated.Gets anIteratorover theEnumobjects in anEnumclass. 
 - 
 
- 
- 
Method Detail
- 
getEnum
public static Enum getEnum(java.lang.Class enumClass, java.lang.String name)
Deprecated.Gets an
Enumobject by class and name.- Parameters:
 enumClass- the class of theEnumto getname- the name of the Enum to get, may benull- Returns:
 - the enum object
 - Throws:
 java.lang.IllegalArgumentException- if the enum class isnull
 
- 
getEnum
public static ValuedEnum getEnum(java.lang.Class enumClass, int value)
Deprecated.Gets a
ValuedEnumobject by class and value.- Parameters:
 enumClass- the class of theEnumto getvalue- the value of theEnumto get- Returns:
 - the enum object, or null if the enum does not exist
 - Throws:
 java.lang.IllegalArgumentException- if the enum class isnull
 
- 
getEnumMap
public static java.util.Map getEnumMap(java.lang.Class enumClass)
Deprecated.Gets the
MapofEnumobjects by name using theEnumclass.If the requested class has no enum objects an empty
Mapis returned. TheMapis unmodifiable.- Parameters:
 enumClass- the class of theEnumto get- Returns:
 - the enum object Map
 - Throws:
 java.lang.IllegalArgumentException- if the enum class isnulljava.lang.IllegalArgumentException- if the enum class is not a subclass ofEnum
 
- 
getEnumList
public static java.util.List getEnumList(java.lang.Class enumClass)
Deprecated.Gets the
ListofEnumobjects using theEnumclass.The list is in the order that the objects were created (source code order).
If the requested class has no enum objects an empty
Listis returned. TheListis unmodifiable.- Parameters:
 enumClass- the class of the Enum to get- Returns:
 - the enum object Map
 - Throws:
 java.lang.IllegalArgumentException- if the enum class isnulljava.lang.IllegalArgumentException- if the enum class is not a subclass ofEnum
 
- 
iterator
public static java.util.Iterator iterator(java.lang.Class enumClass)
Deprecated.Gets an
Iteratorover theEnumobjects in anEnumclass.The iterator is in the order that the objects were created (source code order).
If the requested class has no enum objects an empty
Iteratoris returned. TheIteratoris unmodifiable.- Parameters:
 enumClass- the class of theEnumto get- Returns:
 - an 
Iteratorof theEnumobjects - Throws:
 java.lang.IllegalArgumentException- if the enum class isnulljava.lang.IllegalArgumentException- if the enum class is not a subclass ofEnum
 
 - 
 
 -