Package com.github.jpmsilva.jsystemd
Record Class HealthProvider.Health
java.lang.Object
java.lang.Record
com.github.jpmsilva.jsystemd.HealthProvider.Health
- Record Components:
healthy-trueif this object represents a healthy state,falseotherwisedetails- additional health details for each application component
- Enclosing interface:
- HealthProvider
public static record HealthProvider.Health(boolean healthy, Map<String,Object> details)
extends Record
The health state of an application. Immutable: the details are copied, keeping their order, and cannot be modified.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final HealthProvider.HealthA health object that represents a healthy application state. -
Constructor Summary
Constructors -
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.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
HEALTHY
A health object that represents a healthy application state.
-
-
Constructor Details
-
Health
Provides for a health representation (healthy/unhealthy), with health details for each component.- Parameters:
healthy-trueif this object represents a healthy state,falseotherwisedetails- additional health details for each application component- Throws:
NullPointerException- if details is null
-
-
Method Details
-
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
-
details
Returns the value of thedetailsrecord component.- Returns:
- the value of the
detailsrecord component
-