Enum Class HealthStatus

java.lang.Object
java.lang.Enum<HealthStatus>
com.tnsai.quality.observability.health.HealthStatus
All Implemented Interfaces:
Serializable, Comparable<HealthStatus>, Constable

public enum HealthStatus extends Enum<HealthStatus>
Represents the health status of a component.

Status levels:

  • UP - Component is functioning normally
  • DOWN - Component is not functioning
  • DEGRADED - Component is functioning but with issues
  • UNKNOWN - Component status cannot be determined
  • Enum Constant Details

    • UP

      public static final HealthStatus UP
      Component is functioning normally.
    • DEGRADED

      public static final HealthStatus DEGRADED
      Component is functioning but with reduced capability or performance.
    • UNKNOWN

      public static final HealthStatus UNKNOWN
      Component status cannot be determined.
    • DOWN

      public static final HealthStatus DOWN
      Component is not functioning.
  • Method Details

    • values

      public static HealthStatus[] 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 HealthStatus 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
    • getSeverity

      public int getSeverity()
      Gets the severity level (0 = best, 3 = worst).
      Returns:
      the severity level
    • worse

      public HealthStatus worse(HealthStatus other)
      Returns the worse of two statuses.
      Parameters:
      other - the other status
      Returns:
      the worse status
    • isOperational

      public boolean isOperational()
      Checks if the status indicates the component is operational.
      Returns:
      true if UP or DEGRADED