Enum Class ATOWLifeStage

java.lang.Object
java.lang.Enum<ATOWLifeStage>
mekhq.campaign.personnel.advancedCharacterBuilder.ATOWLifeStage
All Implemented Interfaces:
Serializable, Comparable<ATOWLifeStage>, Constable

public enum ATOWLifeStage extends Enum<ATOWLifeStage>
Enumeration of the distinct life stages in A Time of War character generation.

Each stage has an associated order (for sequence and sorting) and a lookup name (for parsing and display purposes).

Use the fromLookupName(String), fromOrder(int), and fromString(String) methods to retrieve enum values based on textual or numeric input.

Since:
0.50.07
  • Enum Constant Details

  • Method Details

    • values

      public static ATOWLifeStage[] 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 ATOWLifeStage 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
    • getOrder

      public int getOrder()
      Gets the stage's order for sequencing or sorting purposes.
      Returns:
      the defined order for this stage
      Since:
      0.50.07
    • getLookupName

      public String getLookupName()
      Gets the lookup name for use in parsing, serialization, or display.
      Returns:
      the lookup string for this stage
      Since:
      0.50.07
    • getDisplayName

      public String getDisplayName()
      Returns the display name for this object by looking up the ".label" key in the resource bundle associated with this class.
      Returns:
      the localized display name for this object
      Since:
      0.50.11
    • getDescription

      public String getDescription()
      Returns the description for this object by looking up the ".description" key in the resource bundle associated with this class.
      Returns:
      the localized description for this object
      Since:
      0.50.11
    • getOrderedLifeStages

      public static List<ATOWLifeStage> getOrderedLifeStages()
      Returns a list of all ATOWLifeStage values, sorted by their ascending order.
      Returns:
      a sorted list of ATOWLifeStage values by order
      Since:
      0.50.11
    • fromLookupName

      @Nullable public static ATOWLifeStage fromLookupName(String lookup)
      Looks up a ATOWLifeStage by its lookup name, ignoring case.
      Parameters:
      lookup - the lookup name to search for (case-insensitive)
      Returns:
      the matching ATOWLifeStage, or null if not found
      Since:
      0.50.07
    • fromOrder

      @Nullable public static ATOWLifeStage fromOrder(int order)
      Looks up a ATOWLifeStage by its order index.
      Parameters:
      order - the integer order of the desired stage
      Returns:
      the matching ATOWLifeStage, or null if not found
      Since:
      0.50.07
    • fromString

      @Nullable public static ATOWLifeStage fromString(String text)
      Attempts to look up a life stage from its lookup name.

      The lookup name is the only thing that identifies a stage in stored data. This method used to fall back to reading the text as an integer order, which was a trap: order describes the sequence a character passes through the stages, and it is renumbered whenever a stage is added or moved. This branch renumbered every one of them. Anything that had persisted an order would silently resolve to a different stage afterwards.

      Parameters:
      text - the lookup name to search for
      Returns:
      the matching ATOWLifeStage, or null if no match is found
      Since:
      0.50.07
    • toString

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