com.mycompany.myproject.types
Class Gender

java.lang.Object
  extended byorg.xins.common.types.Type
      extended byorg.xins.common.types.EnumType
          extended bycom.mycompany.myproject.types.Gender

public final class Gender
extends EnumType

Enum type Gender.


Nested Class Summary
static class Gender.Item
          Item of the Gender enumeration type.
 
Field Summary
static Gender.Item FEMALE
          The female item.
static Gender.Item MALE
          The male item.
static Gender SINGLETON
          The only instance of this class.
 
Fields inherited from class org.xins.common.types.EnumType
_namesToItems, _valuesToItems
 
Method Summary
static Gender.Item fromStringForOptional(String string)
           
static Gender.Item fromStringForRequired(String string)
           
 Object fromStringImpl(String value)
           
static Gender.Item getItemByName(String name)
          Gets the Item for the specified string name.
static Gender.Item getItemByValue(String value)
          Gets the Item for the specified string value.
 
Methods inherited from class org.xins.common.types.EnumType
getEnumItems, getNameByValue, getValueByName, isValidValueImpl, toString, toString
 
Methods inherited from class org.xins.common.types.Type
checkValue, fromString, getName, getValueClass, isValidValue, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

MALE

public static final Gender.Item MALE
The male item.


FEMALE

public static final Gender.Item FEMALE
The female item.


SINGLETON

public static final Gender SINGLETON
The only instance of this class. This field is never null.

Method Detail

fromStringForRequired

public static Gender.Item fromStringForRequired(String string)
                                         throws IllegalArgumentException,
                                                TypeValueException
Throws:
IllegalArgumentException
TypeValueException

fromStringForOptional

public static Gender.Item fromStringForOptional(String string)
                                         throws TypeValueException
Throws:
TypeValueException

getItemByValue

public static Gender.Item getItemByValue(String value)
                                  throws TypeValueException
Gets the Item for the specified string value.

Parameters:
value - the value for which to lookup the matching Gender.Item instance, can be null, in which case null is also returned.
Returns:
the matching Gender.Item instance, or null if and only if value == null.
Throws:
TypeValueException - if the specified value does not denote an existing item.

getItemByName

public static Gender.Item getItemByName(String name)
                                 throws TypeValueException
Gets the Item for the specified string name.

Parameters:
name - the name for which to lookup the matching Gender.Item instance, can be null, in which case null is also returned.
Returns:
the matching Gender.Item instance, or null if and only if name == null.
Throws:
TypeValueException - if the specified name does not denote an existing item.

fromStringImpl

public Object fromStringImpl(String value)
                      throws TypeValueException
Throws:
TypeValueException