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 Detail

      • Enum8

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

      • 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.
      • 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.