net.sourceforge.jeuclid.context.typewrapper
Class EnumTypeWrapper
java.lang.Object
   net.sourceforge.jeuclid.context.typewrapper.AbstractSimpleTypeWrapper
net.sourceforge.jeuclid.context.typewrapper.AbstractSimpleTypeWrapper
       net.sourceforge.jeuclid.context.typewrapper.EnumTypeWrapper
net.sourceforge.jeuclid.context.typewrapper.EnumTypeWrapper
- All Implemented Interfaces: 
- Serializable, TypeWrapper
- public final class EnumTypeWrapper 
- extends AbstractSimpleTypeWrapper
Converting String to Enum and vice versa is easy with help of Enum class.
- Version:
- $Revision: aa78526a6b7b $
- See Also:
- Serialized Form
 
 
 
 
| Methods inherited from class java.lang.Object | 
| clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait | 
 
getInstance
public static TypeWrapper getInstance(Class<? extends Enum<?>> valueType)
- 
- Parameters:
- valueType- an enum class
- Returns:
- the singleton instance.
 
fromString
public Object fromString(String value)
- Attempts to convert a parameter value expressed as string into an
 instance of the appropriate (for this parameter) type.
 
- 
- Specified by:
- fromStringin interface- TypeWrapper
- Overrides:
- fromStringin class- AbstractSimpleTypeWrapper
 
- 
- Parameters:
- value- parameter value as string
- Returns:
- parameter value as an instance of the proper type
 
values
public Object[] values()
- Retrieves values of the enum type being wrapped.
 
- 
- Returns:
- array of possible enum values
 
Copyright © 2002-2010 The JEuclid project. All Rights Reserved.