Package jnr.ffi
Class Struct.EnumField<E>
- java.lang.Object
-
- jnr.ffi.Struct.Member
-
- jnr.ffi.Struct.NumberField
-
- jnr.ffi.Struct.EnumField<E>
-
- Type Parameters:
E
- the type ofEnum
- Direct Known Subclasses:
Struct.Enum16
,Struct.Enum32
,Struct.Enum64
,Struct.Enum8
,Struct.EnumLong
- Enclosing class:
- Struct
protected abstract class Struct.EnumField<E> extends Struct.NumberField
Base for all the Enum fields.
-
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.Class<E>
enumClass
-
Fields inherited from class jnr.ffi.Struct.NumberField
type
-
-
Constructor Summary
Constructors Constructor Description EnumField(NativeType type, java.lang.Class<E> enumClass)
Constructs a new Enum field.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract E
get()
Gets a java Enum value representing the native integer value.java.lang.String
toString()
Returns a string representation of this field.-
Methods inherited from class jnr.ffi.Struct.NumberField
byteValue, doubleValue, floatValue, getMemory, intValue, longValue, offset, set, shortValue, struct
-
-
-
-
Field Detail
-
enumClass
protected final java.lang.Class<E> enumClass
-
-
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.
-
-
Method Detail
-
get
public abstract E get()
Gets a java Enum value representing the native integer value.- Returns:
- a java Enum value.
-
toString
public final java.lang.String toString()
Returns a string representation of this field.- Overrides:
toString
in classStruct.NumberField
- Returns:
- a string representation of this field.
-
-