Package megamek.common.enums
Enum Class Gender
- All Implemented Interfaces:
Serializable,Comparable<Gender>,Constable
In this context, sex relates to the character's capacity to incubate offspring. While this is a very limited view of
the broad spectrum of human genders, the needs of programming dictate that we need to take a more binary view of
things. To this end, males can't birth children, females can. 'Other' genders are used for characters that fall
outside the gender binary, with the sex following 'other' determining their capacity to birth children.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum Constants -
Method Summary
Modifier and TypeMethodDescriptionDeprecated, for removal: This API element is subject to removal in a future version.Deprecated, for removal: This API element is subject to removal in a future version.booleanbooleanisFemale()booleanbooleanbooleanisMale()static GenderparseFromString(String input) toString()static GenderReturns the enum constant of this class with the specified name.static Gender[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
MALE
-
FEMALE
-
OTHER_MALE
-
OTHER_FEMALE
-
RANDOMIZE
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-
isMale
public boolean isMale()- Returns:
- true if the person's biological gender is male, otherwise false
-
isFemale
public boolean isFemale()- Returns:
- true if the person's biological gender is female, otherwise false
-
isGenderNeutral
public boolean isGenderNeutral()- Returns:
trueif the person uses gender-neutral pronouns, otherwisefalse.
-
isExternal
public boolean isExternal()- Returns:
- true if the enum value can be shown externally
-
isInternal
public boolean isInternal()- Returns:
- true if the enum value is only for internal use
-
getExternalOptions
- Returns:
- a list of all external-facing gender options
-
getExternalVariant
Deprecated, for removal: This API element is subject to removal in a future version.- Returns:
- the external form of the internal gender
-
getInternalVariant
Deprecated, for removal: This API element is subject to removal in a future version.- Returns:
- the internal form of the external gender
-
parseFromString
- Parameters:
input- the string to parse- Returns:
- the gender defined by the input, or a randomly generated string if the string isn't a proper value
-
toString
-