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 FlagEnum> |
fromInteger(long idx,
java.lang.Class<E> clazz)
Returns the enum at position idx
|
static <T extends BitwiseEnum> |
setFromInteger(long flags,
java.lang.Class<T> clazz)
Returns the representing set.
|
static <T extends BitwiseEnum> |
setToInteger(java.util.Set<T> set)
Returns the flags combined into an integer
|
static <E extends FlagEnum> |
toInteger(E val)
Returns the index of the enum in the enum list.
|
public static final int UNINITIALIZED
public static <E extends FlagEnum> long toInteger(E val)
val
- the enumpublic static <E extends FlagEnum> E fromInteger(long idx, java.lang.Class<E> clazz)
idx
- the enum indexclazz
- the enum classpublic static <T extends BitwiseEnum> java.util.Set<T> setFromInteger(long flags, java.lang.Class<T> clazz)
flags
- the ORed flagsclazz
- the enum classpublic static <T extends BitwiseEnum> long setToInteger(java.util.Set<T> set)
set
- the set to convert