Enum Class Health

Object
Enum<Health>
Health
All Implemented Interfaces:
Serializable, Comparable<Health>, Constable

public enum Health extends Enum<Health>
Indicates the health of a person.
Author:
maartenl
  • Enum Constant Details

    • AT_DEATH

      public static final Health AT_DEATH
    • VERY_BAD

      public static final Health VERY_BAD
    • BAD

      public static final Health BAD
    • TERRIBLY_HURT

      public static final Health TERRIBLY_HURT
    • EXTREMELY_HURT

      public static final Health EXTREMELY_HURT
    • QUITE_HURT

      public static final Health QUITE_HURT
    • HURT

      public static final Health HURT
    • SLIGHTLY_HURT

      public static final Health SLIGHTLY_HURT
    • QUITE_NICE

      public static final Health QUITE_NICE
    • NICE

      public static final Health NICE
    • WELL

      public static final Health WELL
    • VERY_WELL

      public static final Health VERY_WELL
  • Method Details

    • values

      public static Health[] 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 Health 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
    • min

      public static Integer min()
    • max

      public static Integer max()
    • getHealth

      public static Health getHealth(Integer health)
      Returns the health of the character. Must be a number between 0 and 11999, where 0..999 is AT_DEATH and 11000..11999 is VERY_WELL.
      Returns:
      Health enum.
    • get

      public static Health get(Integer health)
      Returns the health based on provided ordinal value.
      Returns:
      Health enum or null if not found.
    • get

      public static Health get(String health)
      Returns the health based on a description.
      Returns:
      Health enum or null if not found.
    • getDescription

      public String getDescription()
      Returns the description of this enum.
      Returns:
      for example "at death's door"
    • getOrdinalValue

      public int getOrdinalValue()
      Returns the integer indicating the health.
      Returns:
      integer