Top Description Fields Constructors Methods
com.sun.jna.platform

public Class EnumConverter<T extends java.lang.Enum<T>>

extends Object
implements TypeConverter
Class Inheritance
All Implemented Interfaces
com.sun.jna.TypeConverter, com.sun.jna.ToNativeConverter, com.sun.jna.FromNativeConverter
Type Parameters
<T>
the enum type
Imports
com.sun.jna.FromNativeContext, .ToNativeContext, .TypeConverter

A TypeConverter that maps an integer enum value to an actual Java enum.
Author
Martin Steiger

Field Summary

Modifier and TypeField and Description
private final Class<T>

Constructor Summary

AccessConstructor and Description
public
EnumConverter(Class<T>
the enum class
clazz
)

Method Summary

Modifier and TypeMethod and Description
public T
fromNative(Object input, FromNativeContext context)

Implements com.sun.jna.FromNativeConverter.fromNative.

Convert the given native object into its Java representation using the given context.
public Class<Integer>
nativeType()

Implements com.sun.jna.FromNativeConverter.nativeType, com.sun.jna.ToNativeConverter.nativeType.

Indicate the native type used by this converter.
public Integer
toNative(Object input, ToNativeContext context)

Implements com.sun.jna.ToNativeConverter.toNative.

Convert a Java type to an appropriate native type.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

clazzback to summary
private final Class<T> clazz

Constructor Detail

EnumConverterback to summary
public EnumConverter(Class<T> clazz)
Parameters
clazz:Class<T>

the enum class

Method Detail

fromNativeback to summary
public T fromNative(Object input, FromNativeContext context)

Implements com.sun.jna.FromNativeConverter.fromNative.

Doc from com.sun.jna.FromNativeConverter.fromNative.

Convert the given native object into its Java representation using the given context.

Annotations
@Override
nativeTypeback to summary
public Class<Integer> nativeType()

Implements com.sun.jna.FromNativeConverter.nativeType, com.sun.jna.ToNativeConverter.nativeType.

Doc from com.sun.jna.FromNativeConverter.nativeType.

Indicate the native type used by this converter.

Annotations
@Override
toNativeback to summary
public Integer toNative(Object input, ToNativeContext context)

Implements com.sun.jna.ToNativeConverter.toNative.

Doc from com.sun.jna.ToNativeConverter.toNative.

Convert a Java type to an appropriate native type. The new type must be one of the following classes:

Annotations
@Override