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 class
Gender.Item
Item of the Gender enumeration type.
-
Field Summary
Fields Modifier and Type Field Description static Gender.Item
FEMALE
The female item.static Gender.Item
MALE
The male item.static Gender
SINGLETON
The only instance of this class.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static Gender.Item
fromStringForOptional(java.lang.String string)
static Gender.Item
fromStringForRequired(java.lang.String string)
java.lang.Object
fromStringImpl(java.lang.String value)
java.lang.String
getDescription()
static Gender.Item
getItemByName(java.lang.String name)
Gets theItem
for the specified string name.static Gender.Item
getItemByValue(java.lang.String value)
Gets theItem
for 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.IllegalArgumentException
TypeValueException
-
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 theItem
for the specified string value.- Parameters:
value
- the value for which to lookup the matchingGender.Item
instance, can benull
, in which casenull
is also returned.- Returns:
- the matching
Gender.Item
instance, ornull
if 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 theItem
for the specified string name.- Parameters:
name
- the name for which to lookup the matchingGender.Item
instance, can benull
, in which casenull
is also returned.- Returns:
- the matching
Gender.Item
instance, ornull
if 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:
getDescription
in classType
-
-