Enum Class EducationLevel

java.lang.Object
java.lang.Enum<EducationLevel>
mekhq.campaign.personnel.enums.education.EducationLevel
All Implemented Interfaces:
Serializable, Comparable<EducationLevel>, Constable

public enum EducationLevel extends Enum<EducationLevel>
  • Enum Constant Details

  • Field Details

    • MIN_LEVEL

      public static final int MIN_LEVEL
    • MAX_LEVEL

      public static final int MAX_LEVEL
  • Method Details

    • values

      public static EducationLevel[] 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 EducationLevel 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
    • getToolTipText

      public String getToolTipText()
    • getLevel

      public int getLevel()
    • isEarlyChildhood

      @Deprecated(since="0.51.0", forRemoval=true) public boolean isEarlyChildhood()
      Deprecated, for removal: This API element is subject to removal in a future version.
    • isHighSchool

      @Deprecated(since="0.51.0", forRemoval=true) public boolean isHighSchool()
      Deprecated, for removal: This API element is subject to removal in a future version.
    • isCollege

      public boolean isCollege()
    • isPostGraduate

      public boolean isPostGraduate()
    • isDoctorate

      public boolean isDoctorate()
    • fromString

      public static EducationLevel fromString(String text)
      Converts a string to its corresponding EducationLevel enum constant, if possible.

      This method attempts to map the input string to an EducationLevel in multiple ways:

      • First, it checks if the string matches an enum name exactly.
      • Next, it attempts to parse the string as an integer and map it to the level of the enum.
      • Finally, it checks for a case-insensitive match against the enum names.

      If no match is found, a default value of EARLY_CHILDHOOD is returned, and an error is logged to indicate the invalid input.

      Parameters:
      text - the input string to be converted to an EducationLevel.
      Returns:
      the EducationLevel corresponding to the input text, or EARLY_CHILDHOOD if the input is invalid.
    • fromLevel

      public static EducationLevel fromLevel(int level)
    • toString

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