public class EnumUtils
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static int |
UNINITIALIZED
Uninitialized integer flag
|
Constructor and Description |
---|
EnumUtils() |
Modifier and Type | Method and Description |
---|---|
static <E extends java.lang.Enum<E>> |
fromInteger(int idx,
java.lang.Class<E> clazz) |
static <T extends FlagEnum> |
setFromInteger(int flags,
java.lang.Class<T> clazz) |
static <T extends FlagEnum> |
setToInteger(java.util.Set<T> set) |
static <E extends java.lang.Enum<E>> |
toInteger(E val) |
public static final int UNINITIALIZED
public static <E extends java.lang.Enum<E>> int toInteger(E val)
val
- the enumpublic static <E extends java.lang.Enum<E>> E fromInteger(int idx, java.lang.Class<E> clazz)
idx
- the enum indexclazz
- the enum classpublic static <T extends FlagEnum> java.util.Set<T> setFromInteger(int flags, java.lang.Class<T> clazz)
flags
- the ORed flagsclazz
- the enum classpublic static <T extends FlagEnum> int setToInteger(java.util.Set<T> set)
set
- the set to convert