Package jnr.ffi

Class StructLayout.EnumField<E extends java.lang.Enum<E>>

    • Field Detail

      • enumClass

        protected final java.lang.Class<E extends java.lang.Enum<E>> enumClass
      • enumMapper

        protected final EnumMapper enumMapper
    • Constructor Detail

      • EnumField

        public EnumField​(NativeType type,
                         java.lang.Class<E> enumClass)
        Constructs a new Enum field.
        Parameters:
        type - the native type of the enum.
        enumClass - the Enum class.
      • EnumField

        public EnumField​(NativeType type,
                         java.lang.Class<E> enumClass,
                         StructLayout.Offset offset)
        Constructs a new Enum field.
        Parameters:
        type - the native type of the enum.
        enumClass - the Enum class.
        offset - the offset.
    • Method Detail

      • get

        public E get​(Pointer ptr)
        Gets a java Enum value representing the native integer value.
        Parameters:
        ptr - The pointer to the field.
        Returns:
        a java Enum value.
      • toString

        public final java.lang.String toString​(Pointer ptr)
        Returns a string representation of this field.
        Overrides:
        toString in class StructLayout.NumberField
        Parameters:
        ptr - The pointer to the field.
        Returns:
        a string representation of this field.