Enum Class ScheduleState

java.lang.Object
java.lang.Enum<ScheduleState>
top.wcpe.beacon.agent.api.ScheduleState
All Implemented Interfaces:
Serializable, Comparable<ScheduleState>, Constable

public enum ScheduleState extends Enum<ScheduleState>
一次选服决策的结论类别(FR-244):把「有结果」「空结果」「没做成」三件事分成三个取值。

为什么必须分开

调用方对三者的恢复动作方向相反:

  • CHOSEN:拿到了目标,照常往下走。
  • NO_CANDIDATE:稳定事实——本次作用域内确实没有满足条件的候选。 重试不会改口,恢复动作是换区 / 调整服务范围 / 找人工,不该重试。
  • UNAVAILABLE:当前状态——门面或通道此刻不可用(超时 / 连接失败 / 读不出结论), 结论未知。恢复动作是等通道恢复后重试,不该被读成「没有候选」而永久放弃一次派房。

拿同一个返回值(例如 chosen() == null)承载后两者,会让调用方把「看不到」印成「没有」, 或反过来把「确实没有」当成「暂时不可用」去无限重试——两条路都静默。

  • Enum Constant Details

  • Method Details

    • values

      public static ScheduleState[] 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

      public static ScheduleState valueOf(String name)
      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 name
      NullPointerException - if the argument is null