Enum Class Appetite
- All Implemented Interfaces:
Serializable
,Comparable<Appetite>
,Constable
Indicates the appetite of a person.
- Author:
- maartenl
-
Nested Class Summary
Nested classes/interfaces inherited from class Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum Constants -
Method Summary
Modifier and TypeMethodDescriptionstatic Appetite
Returns the appetite based on provided ordinal value.static Appetite
Returns the appetite based on a description.static Appetite
getAppetite
(Integer appetite) Returns the appetite of the character.Returns the description of this enum.int
Returns the integer indicating the appetite.static Integer
max()
static Integer
min()
static Appetite
Returns the enum constant of this class with the specified name.static Appetite[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
HUNGRY
-
EAT_WHOLE_LOT_MORE
-
EAT_LOT_MORE
-
EAT_SOME
-
EAT_LITTLE
-
FULL
-
-
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
-
min
-
max
-
getAppetite
Returns the appetite of the character. Must be a number between 0 and 5999, where 0..999 is HUNGRY and 5000..5999 is FULL.- Returns:
- Appetite enum.
- Throws:
RuntimeException
- if the appetite is not allowedNullPointerException
- if appetite not provided
-
get
-
get
-
getDescription
Returns the description of this enum.- Returns:
- for example "at death's door"
-
getOrdinalValue
public int getOrdinalValue()Returns the integer indicating the appetite.- Returns:
- integer
-