org.kiwiproject.metrics.health.HealthStatusComparator Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of metrics-healthchecks-severity Show documentation
Show all versions of metrics-healthchecks-severity Show documentation
Very small library that augments Dropwizard Metrics health checks with a severity detail.
The newest version!
package org.kiwiproject.metrics.health;
import java.util.Comparator;
/**
* A Comparator that compares {@link HealthStatus} objects by severity.
*/
class HealthStatusComparator implements Comparator {
static final HealthStatusComparator INSTANCE = new HealthStatusComparator();
@Override
public int compare(HealthStatus status1, HealthStatus status2) {
return Comparator.comparingInt(HealthStatus::getValue).compare(status1, status2);
}
}