Package com.elitesland.ystdms.sys.enums
Enum Class ApiCode
- All Implemented Interfaces:
Serializable,Comparable<ApiCode>,Constable
-
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 ApiCodegetApiCode(int code) 根据状态码获取枚举intgetCode()获取状态码获取信息内容int获取错误码boolean判断是否为客户端错误boolean判断是否为服务端错误boolean判断是否为成功状态码static ApiCodeReturns the enum constant of this class with the specified name.static ApiCode[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
SUCCESS
-
REDIRECT
-
BAD_REQUEST
-
PARAMETER_PARSE_EXCEPTION
-
PARAMETER_EXCEPTION
-
VALIDATE_FAILED
-
AUTHENTICATION_EXCEPTION
-
UNAUTHORIZED
-
NOT_PERMISSION
-
NOT_FOUND
-
NOT_FOUND_DATA
-
METHOD_NOT_SUPPORT
-
NOT_ACCEPTABLE
-
REQUEST_ENTITY_TOO_LARGE
-
REQUEST_URL_TOO_LONG
-
UNSUPPORTED_MEDIA_TYPE
-
REQUEST_TOO_MANY
-
SIGNATURE_ERROR
-
FAIL
-
NOT_IMPLEMENTED
-
SYSTEM_EXCEPTION
-
DATABASE_EXCEPTION
-
ELASTICSEARCH_EXCEPTION
-
SYSTEM_BUSY
-
VISITOR_TOO_MANY
-
THREAD_POOL_OVERFLOW
-
NO_PROVIDER
-
PROVIDER_EXCEPTION
-
GATEWAY_TIMEOUT
-
REQUEST_TIMEOUT
-
BUSINESS_EXCEPTION
-
-
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
-
getApiCode
根据状态码获取枚举- Parameters:
code- 状态码- Returns:
- ApiCode枚举
-
isSuccess
public boolean isSuccess()判断是否为成功状态码- Returns:
- 是否成功
-
isClientError
public boolean isClientError()判断是否为客户端错误- Returns:
- 是否为客户端错误
-
isServerError
public boolean isServerError()判断是否为服务端错误- Returns:
- 是否为服务端错误
-
getCode
public int getCode()获取状态码- Returns:
- 状态码值
-
getErrorNo
public int getErrorNo()获取错误码- Returns:
- 错误码值
-
getErrorMsg
获取信息内容- Returns:
- 信息内容
-
getMsgFriendly
-