Package jnr.ffi

Class Struct.Enum8<E extends Enum<E>>

Type Parameters:
E - the Enum to translate to/from.
Enclosing class:
Struct

public class Struct.Enum8<E extends Enum<E>> extends Struct.EnumField<E>
An 8 bit enum field.
  • Constructor Details

    • Enum8

      public Enum8(Class<E> enumClass)
      Creates a new 8 bit enum field.
      Parameters:
      enumClass - the class of the Enum.
  • Method Details

    • get

      public final E get()
      Gets a java Enum value representing the native integer value.
      Specified by:
      get in class Struct.EnumField<E extends Enum<E>>
      Returns:
      a java Enum value.
    • set

      public final void set(E value)
      Sets the native integer value using a java Enum value.
      Parameters:
      value - the java Enum value.
    • set

      public void set(Number value)
      Description copied from class: Struct.NumberField
      Sets the field to a new value.
      Specified by:
      set in class Struct.NumberField
      Parameters:
      value - The new value.
    • intValue

      public final int intValue()
      Returns an integer representation of this enum field.
      Specified by:
      intValue in class Struct.NumberField
      Returns:
      an integer value for this enum field.