Package dev.agenor.tools.health
Record Class HealthCheckService.HealthReport
java.lang.Object
java.lang.Record
dev.agenor.tools.health.HealthCheckService.HealthReport
- Enclosing class:
HealthCheckService
public static record HealthCheckService.HealthReport(HealthCheckService.HealthStatus status, Map<String,HealthCheckService.HealthStatus> components, Duration uptime)
extends Record
-
Constructor Summary
ConstructorsConstructorDescriptionHealthReport(HealthCheckService.HealthStatus status, Map<String, HealthCheckService.HealthStatus> components, Duration uptime) Creates an instance of aHealthReportrecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of thecomponentsrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.booleanstatus()Returns the value of thestatusrecord component.toMap()final StringtoString()Returns a string representation of this record class.uptime()Returns the value of theuptimerecord component.
-
Constructor Details
-
HealthReport
public HealthReport(HealthCheckService.HealthStatus status, Map<String, HealthCheckService.HealthStatus> components, Duration uptime) Creates an instance of aHealthReportrecord class.- Parameters:
status- the value for thestatusrecord componentcomponents- the value for thecomponentsrecord componentuptime- the value for theuptimerecord component
-
-
Method Details
-
isHealthy
public boolean isHealthy() -
toMap
-
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. All components in this record class are compared withObjects::equals(Object,Object). -
status
Returns the value of thestatusrecord component.- Returns:
- the value of the
statusrecord component
-
components
Returns the value of thecomponentsrecord component.- Returns:
- the value of the
componentsrecord component
-
uptime
Returns the value of theuptimerecord component.- Returns:
- the value of the
uptimerecord component
-