Package dev.davwheat.enums
Enum AnimalLevel
- java.lang.Object
-
- java.lang.Enum<AnimalLevel>
-
- dev.davwheat.enums.AnimalLevel
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Comparable<AnimalLevel>
,java.lang.constant.Constable
public enum AnimalLevel extends java.lang.Enum<AnimalLevel>
-
-
Enum Constant Summary
Enum Constants Enum Constant Description LEVEL_ONE
LEVEL_THREE
LEVEL_TWO
LEVEL_ZERO
-
Field Summary
Fields Modifier and Type Field Description int
value
-
Method Summary
Modifier and Type Method Description static AnimalLevel
fromNumberValue(int value)
Fetches an AnimalLevel from a level number (0-3).static AnimalLevel
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.static AnimalLevel[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
LEVEL_ZERO
public static final AnimalLevel LEVEL_ZERO
-
LEVEL_ONE
public static final AnimalLevel LEVEL_ONE
-
LEVEL_TWO
public static final AnimalLevel LEVEL_TWO
-
LEVEL_THREE
public static final AnimalLevel LEVEL_THREE
-
-
Method Detail
-
values
public static AnimalLevel[] values()
Returns an array containing the constants of this enum type, in the order they are declared.- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static AnimalLevel valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (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:
java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is null
-
fromNumberValue
public static AnimalLevel fromNumberValue(int value)
Fetches an AnimalLevel from a level number (0-3).Calling this with a number outside 0-3 will throw an IllegalArgumentException.
We should try our best to NOT use this where we can, as the enum values themselves should be good enough for most cases.
- Parameters:
value
- Level integer (0-3)- Returns:
- the level for the provided int
-
-