Enum Class HealthStatus
- All Implemented Interfaces:
Serializable, Comparable<HealthStatus>, Constable
Enumeration of possible health check statuses.
健康检查状态枚举。
Represents the overall health of a component: UP (healthy),
DOWN (unhealthy), or DEGRADED (partially healthy).
The aggregate(Collection) method computes the worst-case status from a collection.
表示组件的整体健康状态:UP(健康)、DOWN(不健康)
或 DEGRADED(部分健康)。aggregate(Collection) 方法从集合中计算最差状态。
- Since:
- JDK 25, opencode-base-observability V1.0.3
- Author:
- Leon Soo www.LeonSoo.com
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class Enum
Enum.EnumDesc<E> -
Enum Constant Summary
Enum Constants -
Method Summary
Modifier and TypeMethodDescriptionstatic HealthStatusaggregate(Collection<HealthStatus> statuses) Aggregates a collection of statuses into a single worst-case status.static HealthStatusReturns the enum constant of this class with the specified name.static HealthStatus[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
UP
The component is healthy. 组件健康。 -
DOWN
The component is unhealthy. 组件不健康。 -
DEGRADED
The component is partially healthy. 组件部分健康。
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-
aggregate
Aggregates a collection of statuses into a single worst-case status. 将一组状态聚合为单个最差状态。DOWNtakes highest priority, followed byDEGRADED, thenUP. A null or empty collection returnsUP.- Parameters:
statuses- the collection of statuses to aggregate | 要聚合的状态集合- Returns:
- the aggregated worst-case status | 聚合后的最差状态
-