Record Class HealthStatus
java.lang.Object
java.lang.Record
codes.grow.packages.skywalking.core.HealthStatus
- Record Components:
healthy- whether the service is usablestatus-ok,degraded,unhealthy,unreachableor a vendor worddetails- extra vendor details
public record HealthStatus(boolean healthy, String status, Map<String,String> details)
extends Record
Result of
health() (SPEC section 2.4).-
Constructor Summary
ConstructorsConstructorDescriptionHealthStatus(boolean healthy, String status, Map<String, String> details) Creates a status; details are copied. -
Method Summary
Modifier and TypeMethodDescriptiondetails()Returns the value of thedetailsrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.booleanhealthy()Returns the value of thehealthyrecord component.static HealthStatusok()A healthyokstatus without details.status()Returns the value of thestatusrecord component.final StringtoString()Returns a string representation of this record class.static HealthStatusunreachable(String reason) The status for a service that could not be reached.
-
Constructor Details
-
HealthStatus
Creates a status; details are copied.- Parameters:
healthy- whether the service is usablestatus- status worddetails- extra details
-
-
Method Details
-
ok
A healthyokstatus without details.- Returns:
- the status
-
unreachable
The status for a service that could not be reached.- Parameters:
reason- redacted reason, stored in details undererror- Returns:
- an unhealthy
unreachablestatus
-
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. -
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. -
equals
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
healthy
public boolean healthy()Returns the value of thehealthyrecord component.- Returns:
- the value of the
healthyrecord component
-
status
Returns the value of thestatusrecord component.- Returns:
- the value of the
statusrecord component
-
details
Returns the value of thedetailsrecord component.- Returns:
- the value of the
detailsrecord component
-