Enum Class Year
- All Implemented Interfaces:
Serializable,Comparable<Year>,Constable
Represents the year this player is in school.
-
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 TypeMethodDescription@NotNull StringGet the text for writing this year, example: "3rd year"The highest spell level this year can do without possible experience penalties.static @Nullable YeargetYearByValue(int value) Get the year that has the corresponding valuestatic YearReturns the enum constant of this class with the specified name.static Year[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
YEAR_1
"1st", MagicLevel.BEGINNER -
YEAR_2
"2nd", MagicLevel.BEGINNER -
YEAR_3
"3rd", MagicLevel.OWL -
YEAR_4
"4th", MagicLevel.OWL -
YEAR_5
"5th", MagicLevel.NEWT -
YEAR_6
"6th", MagicLevel.NEWT -
YEAR_7
"7th", MagicLevel.EXPERT
-
-
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
-
getDisplayText
Get the text for writing this year, example: "3rd year"- Returns:
- the display text for this year
-
getYearByValue
Get the year that has the corresponding value- Parameters:
value- the value to get- Returns:
- the Year if exists, null otherwise
-
getHighestLevelForYear
The highest spell level this year can do without possible experience penalties.- Returns:
- the maximum spell level
-