Record Class Health.Report

java.lang.Object
java.lang.Record
com.jsgalactic.axiom.observability.Health.Report
Record Components:
status - UP only when every check is UP and, for readiness, the application accepts traffic
checks - each check's state in registration order; empty when no check ran
Enclosing class:
Health

public static record Health.Report(Health.Status status, Map<String,Health.Status> checks) extends Record
The outcome of one probe.
  • Constructor Details

  • Method Details

    • toJson

      public String toJson()
      Renders the report as small JSON: {"status":"UP","checks":{"database":"UP"}}. Check names are restricted to letters, digits and _ . -, so no escaping is needed.
      Returns:
      JSON text
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • status

      public Health.Status status()
      Returns the value of the status record component.
      Returns:
      the value of the status record component
    • checks

      public Map<String,Health.Status> checks()
      Returns the value of the checks record component.
      Returns:
      the value of the checks record component