org.rococoa.contrib
Class NativeEnum.Resolver
java.lang.Object
org.rococoa.contrib.NativeEnum.Resolver
- Enclosing interface:
- NativeEnum<N extends NSObject>
public static final class NativeEnum.Resolver
- extends Object
Given a native value, resolve the corresponding enum entry.
Method Summary |
static
|
fromNative(Class<E> nativeEnum,
NSObject value)
Given an enum class that implements NativeEnum, resolve the Java enum
value that corresponds to the native value value |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
fromNative
public static <E extends Enum<E> & NativeEnum<?>> E fromNative(Class<E> nativeEnum,
NSObject value)
- Given an enum class that implements NativeEnum, resolve the Java enum
value that corresponds to the native value
value
- Type Parameters:
E
- the type of the Java enum- Parameters:
nativeEnum
- the class of the Java enumvalue
- the native value to resolve
- Returns:
- the corresponding Java enum value
- Throws:
IllegalArgumentException
- if value
does not correspond to any
value in the Java enum
Copyright © 2012. All Rights Reserved.