Klasse 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)
Autor:
Martin Steiger
  • Felddetails

    • UNINITIALIZED

      public static final int UNINITIALIZED
      Uninitialized integer flag
      Siehe auch:
  • Konstruktordetails

    • EnumUtils

      public EnumUtils()
  • Methodendetails

    • toInteger

      public static <E extends Enum<E>> int toInteger(E val)
      Parameter:
      val - the enum
      Gibt zurück:
      the index of the enum in the enum list
    • fromInteger

      public static <E extends Enum<E>> E fromInteger(int idx, Class<E> clazz)
      Parameter:
      idx - the enum index
      clazz - the enum class
      Gibt zurück:
      the enum at position idx
    • setFromInteger

      public static <T extends FlagEnum> Set<T> setFromInteger(int flags, Class<T> clazz)
      Parameter:
      flags - the ORed flags
      clazz - the enum class
      Gibt zurück:
      the representing set
    • setToInteger

      public static <T extends FlagEnum> int setToInteger(Set<T> set)
      Parameter:
      set - the set to convert
      Gibt zurück:
      the flags combined into an integer