Package top.wcpe.beacon.agent.api
Enum Class ScheduleState
- All Implemented Interfaces:
Serializable,Comparable<ScheduleState>,Constable
一次选服决策的结论类别(FR-244):把「有结果」「空结果」「没做成」三件事分成三个取值。
为什么必须分开
调用方对三者的恢复动作方向相反:
CHOSEN:拿到了目标,照常往下走。NO_CANDIDATE:稳定事实——本次作用域内确实没有满足条件的候选。 重试不会改口,恢复动作是换区 / 调整服务范围 / 找人工,不该重试。UNAVAILABLE:当前状态——门面或通道此刻不可用(超时 / 连接失败 / 读不出结论), 结论未知。恢复动作是等通道恢复后重试,不该被读成「没有候选」而永久放弃一次派房。
拿同一个返回值(例如 chosen() == null)承载后两者,会让调用方把「看不到」印成「没有」,
或反过来把「确实没有」当成「暂时不可用」去无限重试——两条路都静默。
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescription选出了候选(ScheduleResult.chosen()非 null)。决策成立、结论为「没有满足条件的候选」(ScheduleResult.chosen()为 null)。决策没做成(结论未知,可重试);ScheduleResult.chosen()为 null。 -
Method Summary
Modifier and TypeMethodDescriptionstatic ScheduleStateReturns the enum constant of this class with the specified name.static ScheduleState[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
CHOSEN
选出了候选(ScheduleResult.chosen()非 null)。 -
NO_CANDIDATE
决策成立、结论为「没有满足条件的候选」(ScheduleResult.chosen()为 null)。它与「作用域把候选全滤掉了」是同一类结论(都不可重试),具体是哪一种看
ScheduleResult.failReason()。 -
UNAVAILABLE
决策没做成(结论未知,可重试);ScheduleResult.chosen()为 null。
-
-
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
-