Enum Class RetCode

java.lang.Object
java.lang.Enum<RetCode>
com.midi.his.sdk.enums.RetCode
所有已实现的接口:
Serializable, Comparable<RetCode>, Constable

public enum RetCode extends Enum<RetCode>
集成平台业务返回码,取自 RetInfo/RetCode。

语义来自 docs/WebServer/消息外层格式定义/响应格式.xml: 1 成功、0 无匹配记录、-1 用户名密码服务匹配错误、-99 其他错误。

  • 枚举常量详细资料

    • SUCCESS

      public static final RetCode SUCCESS
      1:查询命中或推送受理成功。
    • NO_MATCH

      public static final RetCode NO_MATCH
      0:条件合法但没有数据,SDK 不视为异常。
    • AUTH_FAILED

      public static final RetCode AUTH_FAILED
      -1:用户名、密码与 Fid/OrderNo 不匹配,属于配置错误。
    • OTHER_ERROR

      public static final RetCode OTHER_ERROR
      -99:平台侧其它错误,需要按 RetCon 文本定位。
    • UNKNOWN

      public static final RetCode UNKNOWN
      平台返回了未约定的取值,或响应里缺少 RetCode。
  • 方法详细资料

    • values

      public static RetCode[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      返回:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static RetCode 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.)
      参数:
      name - 要返回的枚举常量的名称。
      返回:
      返回带有指定名称的枚举常量
      抛出:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - 如果参数为空值
    • code

      public String code()
      返回:
      写入报文的原始字符串
    • description

      public String description()
      返回:
      中文语义
    • isSuccess

      public boolean isSuccess()
      返回:
      是否代表业务处理成功
    • retryable

      public boolean retryable()
      该错误是否可能由瞬时故障造成。

      SDK 只在传输层失败(超时、连接重置、HTTP 5xx)时重试;一旦拿到业务返回码就不再重试, 因此本方法对 OTHER_ERROR 也返回 false。

      返回:
      恒为 false,保留用于调用方自行决策
    • of

      public static RetCode of(String raw)
      按报文原文解析返回码,空白与未知取值归入 UNKNOWN。
      参数:
      raw - RetCode 节点文本
      返回:
      对应枚举,不会返回 null