java.lang.Object
org.springframework.boot.actuate.health.Status

public final class Status extends Object
Value object to express state of a component or subsystem.

Status provides convenient constants for commonly used states like UP, DOWN or OUT_OF_SERVICE.

Custom states can also be created and used throughout the Spring Boot Health subsystem.

Since:
1.1.0
Author:
Christian Dupuis
  • Field Details

    • UNKNOWN

      public static final Status UNKNOWN
      Status indicating that the component or subsystem is in an unknown state.
    • UP

      public static final Status UP
      Status indicating that the component or subsystem is functioning as expected.
    • DOWN

      public static final Status DOWN
      Status indicating that the component or subsystem has suffered an unexpected failure.
    • OUT_OF_SERVICE

      public static final Status OUT_OF_SERVICE
      Status indicating that the component or subsystem has been taken out of service and should not be used.
  • Constructor Details

    • Status

      public Status(String code)
      Create a new Status instance with the given code and an empty description.
      Parameters:
      code - the status code
    • Status

      public Status(String code, String description)
      Create a new Status instance with the given code and description.
      Parameters:
      code - the status code
      description - a description of the status
  • Method Details

    • getCode

      public String getCode()
      Return the code for this status.
      Returns:
      the code
    • getDescription

      public String getDescription()
      Return the description of this status.
      Returns:
      the description
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object