Enum Class ResultCode

java.lang.Object
java.lang.Enum<ResultCode>
com.imyeyu.java.bean.ResultCode
All Implemented Interfaces:
Serializable, Comparable<ResultCode>, Constable

public enum ResultCode extends Enum<ResultCode>
通用代码(基于 HTTP 代码扩展)
Since:
2021-05-21 14:32
Author:
夜雨
  • Enum Constant Details

    • SUCCESS

      public static final ResultCode SUCCESS
      执行成功
    • IGNORE

      public static final ResultCode IGNORE
      执行成功,忽略请求
    • ARG_MISS

      public static final ResultCode ARG_MISS
      缺少参数
    • ARG_BAD

      public static final ResultCode ARG_BAD
      不合法的参数
    • ARG_EXPIRED

      public static final ResultCode ARG_EXPIRED
      过期的参数
    • PERMISSION_MISS

      public static final ResultCode PERMISSION_MISS
      无权限
    • PERMISSION_ERROR

      public static final ResultCode PERMISSION_ERROR
      无权限
    • REQUEST_BAD

      public static final ResultCode REQUEST_BAD
      非法请求
    • DATA_EXIST

      public static final ResultCode DATA_EXIST
      数据已存在
    • RESULT_NULL

      public static final ResultCode RESULT_NULL
      无数据
    • RESULT_BAD

      public static final ResultCode RESULT_BAD
      返回数据异常
    • RESULT_BAN

      public static final ResultCode RESULT_BAN
      禁用的数据
    • RESULT_TIMEOUT

      public static final ResultCode RESULT_TIMEOUT
      上游服务器连接超时
    • ERROR

      public static final ResultCode ERROR
      服务异常
    • ERROR_NOT_SUPPORT

      public static final ResultCode ERROR_NOT_SUPPORT
      服务异常
    • ERROR_NPE_VARIABLE

      public static final ResultCode ERROR_NPE_VARIABLE
      服务异常
    • ERROR_SERVICE_OFF

      public static final ResultCode ERROR_SERVICE_OFF
      服务关闭
    • ERROR_SERVICE_BUSY

      public static final ResultCode ERROR_SERVICE_BUSY
      服务繁忙
  • Method Details

    • values

      public static ResultCode[] 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 ResultCode 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
    • toException

      public ActionException toException()
      转为通用异常
      Returns:
      异常
    • toException

      public ActionException toException(String msg)
      转为通用异常
      Parameters:
      msg - 异常消息
      Returns:
      异常
    • toResponse

      public Response<?> toResponse()
      转为通用返回对象
      Returns:
      返回对象
    • fromCode

      public static ResultCode fromCode(int code)
      根据代码返回对象
      Parameters:
      code - 代码
      Returns:
      对象
    • getValue

      public Integer getValue()
      代码