Package com.sun.jna.platform
Class EnumUtils
- java.lang.Object
-
- com.sun.jna.platform.EnumUtils
-
public class EnumUtils extends Object
Several helper methods to convert integer flag (sets) into enum (sets)- Author:
- Martin Steiger
-
-
Field Summary
Fields Modifier and Type Field Description static int
UNINITIALIZED
Uninitialized integer flag
-
Constructor Summary
Constructors Constructor Description EnumUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <E extends Enum<E>>
EfromInteger(int idx, Class<E> clazz)
static <T extends FlagEnum>
Set<T>setFromInteger(int flags, Class<T> clazz)
static <T extends FlagEnum>
intsetToInteger(Set<T> set)
static <E extends Enum<E>>
inttoInteger(E val)
-
-
-
Field Detail
-
UNINITIALIZED
public static final int UNINITIALIZED
Uninitialized integer flag- See Also:
- Constant Field Values
-
-
Method Detail
-
toInteger
public static <E extends Enum<E>> int toInteger(E val)
- Parameters:
val
- the enum- Returns:
- the index of the enum in the enum list
-
fromInteger
public static <E extends Enum<E>> E fromInteger(int idx, Class<E> clazz)
- Parameters:
idx
- the enum indexclazz
- the enum class- Returns:
- the enum at position idx
-
setFromInteger
public static <T extends FlagEnum> Set<T> setFromInteger(int flags, Class<T> clazz)
- Parameters:
flags
- the ORed flagsclazz
- the enum class- Returns:
- the representing set
-
-