Use ordinal instead of value for Gender.

This commit is contained in:
Major-
2013-12-30 09:53:49 +00:00
parent e79772ec18
commit 1063dbc8b9
+3 -17
View File
@@ -10,26 +10,12 @@ public enum Gender {
/** /**
* The male gender. * The male gender.
*/ */
MALE(0), MALE,
/** /**
* The female gender. * The female gender.
*/ */
FEMALE(1); FEMALE;
/**
* The numerical value used by the client.
*/
private final int value;
/**
* Creates the gender.
*
* @param value The numerical value.
*/
private Gender(int value) {
this.value = value;
}
/** /**
* Converts this gender to an integer. * Converts this gender to an integer.
@@ -37,7 +23,7 @@ public enum Gender {
* @return The numerical value used by the client. * @return The numerical value used by the client.
*/ */
public int toInteger() { public int toInteger() {
return value; return ordinal();
} }
} }