Enum Class ATOWLifeStage
- All Implemented Interfaces:
Serializable,Comparable<ATOWLifeStage>,Constable
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
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescription -
Method Summary
Modifier and TypeMethodDescriptionstatic ATOWLifeStagefromLookupName(String lookup) Looks up aATOWLifeStageby its lookup name, ignoring case.static ATOWLifeStagefromOrder(int order) Looks up aATOWLifeStageby its order index.static ATOWLifeStagefromString(String text) Attempts to look up a life stage from its lookup name.Returns the description for this object by looking up the ".description" key in the resource bundle associated with this class.Returns the display name for this object by looking up the ".label" key in the resource bundle associated with this class.Gets the lookup name for use in parsing, serialization, or display.intgetOrder()Gets the stage's order for sequencing or sorting purposes.static List<ATOWLifeStage> Returns a list of allATOWLifeStagevalues, sorted by their ascending order.toString()static ATOWLifeStageReturns the enum constant of this class with the specified name.static ATOWLifeStage[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
AFFILIATION
-
SUB_AFFILIATION
-
CLAN_CASTE
-
SUPPLEMENTAL
-
EARLY_CHILDHOOD
-
LATE_CHILDHOOD
-
HIGHER_EDUCATION
-
REAL_LIFE
-
-
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
-
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
Gets the lookup name for use in parsing, serialization, or display.- Returns:
- the lookup string for this stage
- Since:
- 0.50.07
-
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
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
Returns a list of allATOWLifeStagevalues, sorted by their ascending order.- Returns:
- a sorted list of
ATOWLifeStagevalues by order - Since:
- 0.50.11
-
fromLookupName
Looks up aATOWLifeStageby its lookup name, ignoring case.- Parameters:
lookup- the lookup name to search for (case-insensitive)- Returns:
- the matching ATOWLifeStage, or
nullif not found - Since:
- 0.50.07
-
fromOrder
Looks up aATOWLifeStageby its order index.- Parameters:
order- the integer order of the desired stage- Returns:
- the matching
ATOWLifeStage, ornullif not found - Since:
- 0.50.07
-
fromString
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:orderdescribes 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, ornullif no match is found - Since:
- 0.50.07
-
toString
- Overrides:
toStringin classEnum<ATOWLifeStage>
-