Package com.mycompany.myproject.types
Class Gender
- java.lang.Object
-
- org.xins.common.types.Type
-
- org.xins.common.types.EnumType
-
- com.mycompany.myproject.types.Gender
-
public final class Gender extends EnumType
Enum type Gender.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classGender.ItemItem of the Gender enumeration type.
-
Field Summary
Fields Modifier and Type Field Description static Gender.ItemFEMALEThe female item.static Gender.ItemMALEThe male item.static GenderSINGLETONThe only instance of this class.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static Gender.ItemfromStringForOptional(java.lang.String string)static Gender.ItemfromStringForRequired(java.lang.String string)java.lang.ObjectfromStringImpl(java.lang.String value)java.lang.StringgetDescription()static Gender.ItemgetItemByName(java.lang.String name)Gets theItemfor the specified string name.static Gender.ItemgetItemByValue(java.lang.String value)Gets theItemfor the specified string value.-
Methods inherited from class org.xins.common.types.EnumType
getEnumItems, getNameByValue, getValueByName, toString, toString
-
Methods inherited from class org.xins.common.types.Type
checkValue, fromString, getName, getValueClass, isValidValue, toString
-
-
-
-
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 nevernull.
-
-
Method Detail
-
fromStringForRequired
public static Gender.Item fromStringForRequired(java.lang.String string) throws java.lang.IllegalArgumentException, TypeValueException
- Throws:
java.lang.IllegalArgumentExceptionTypeValueException
-
fromStringForOptional
public static Gender.Item fromStringForOptional(java.lang.String string) throws TypeValueException
- Throws:
TypeValueException
-
getItemByValue
public static Gender.Item getItemByValue(java.lang.String value) throws TypeValueException
Gets theItemfor the specified string value.- Parameters:
value- the value for which to lookup the matchingGender.Iteminstance, can benull, in which casenullis also returned.- Returns:
- the matching
Gender.Iteminstance, ornullif and only ifvalue == null. - Throws:
TypeValueException- if the specified value does not denote an existing item.
-
getItemByName
public static Gender.Item getItemByName(java.lang.String name) throws TypeValueException
Gets theItemfor the specified string name.- Parameters:
name- the name for which to lookup the matchingGender.Iteminstance, can benull, in which casenullis also returned.- Returns:
- the matching
Gender.Iteminstance, ornullif and only ifname == null. - Throws:
TypeValueException- if the specified name does not denote an existing item.
-
fromStringImpl
public java.lang.Object fromStringImpl(java.lang.String value) throws TypeValueException- Throws:
TypeValueException
-
getDescription
public java.lang.String getDescription()
- Overrides:
getDescriptionin classType
-
-