Enum Class Gender

java.lang.Object
java.lang.Enum<Gender>
megamek.common.enums.Gender
All Implemented Interfaces:
Serializable, Comparable<Gender>, Constable

public enum Gender extends Enum<Gender>
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.
  • Enum Constant Details

    • MALE

      public static final Gender MALE
    • FEMALE

      public static final Gender FEMALE
    • OTHER_MALE

      public static final Gender OTHER_MALE
    • OTHER_FEMALE

      public static final Gender OTHER_FEMALE
    • RANDOMIZE

      public static final Gender RANDOMIZE
  • Method Details

    • values

      public static Gender[] 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

      public static Gender valueOf(String name)
      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 name
      NullPointerException - 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:
      true if the person uses gender-neutral pronouns, otherwise false.
    • 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

      public static List<Gender> getExternalOptions()
      Returns:
      a list of all external-facing gender options
    • getExternalVariant

      @Deprecated(since="0.51.0", forRemoval=true) public Gender 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(since="0.51.0", forRemoval=true) public 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

      public static Gender parseFromString(String input)
      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

      public String toString()
      Overrides:
      toString in class Enum<Gender>