Package com.imyeyu.java.bean.timi
Enum Class TimiCode
- All Implemented Interfaces:
Serializable,Comparable<TimiCode>,Constable
通用代码(基于 HTTP 代码扩展)
- Since:
- 2021-05-21 14:32
- Author:
- 夜雨
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescription不合法的参数过期的参数缺少参数数据已存在服务异常服务异常服务异常服务繁忙服务关闭执行成功,忽略请求无权限无权限非法请求返回数据异常禁用的数据无数据上游服务器连接超时执行成功 -
Method Summary
Modifier and TypeMethodDescriptionstatic TimiCodefromCode(int code) 根据代码返回对象getValue()代码转为通用异常toException(String msg) 转为通用异常TimiResponse<?> 转为通用返回对象static TimiCodeReturns the enum constant of this class with the specified name.static TimiCode[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
SUCCESS
执行成功 -
IGNORE
执行成功,忽略请求 -
ARG_MISS
缺少参数 -
ARG_BAD
不合法的参数 -
ARG_EXPIRED
过期的参数 -
PERMISSION_MISS
无权限 -
PERMISSION_ERROR
无权限 -
REQUEST_BAD
非法请求 -
DATA_EXIST
数据已存在 -
RESULT_NULL
无数据 -
RESULT_BAD
返回数据异常 -
RESULT_BAN
禁用的数据 -
RESULT_TIMEOUT
上游服务器连接超时 -
ERROR
服务异常 -
ERROR_NOT_SUPPORT
服务异常 -
ERROR_NPE_VARIABLE
服务异常 -
ERROR_SERVICE_OFF
服务关闭 -
ERROR_SERVICE_BUSY
服务繁忙
-
-
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
-
toException
转为通用异常- Returns:
- 异常
-
toException
转为通用异常- Parameters:
msg- 异常消息- Returns:
- 异常
-
toResponse
转为通用返回对象- Returns:
- 返回对象
-
fromCode
根据代码返回对象- Parameters:
code- 代码- Returns:
- 对象
-
getValue
代码
-