public abstract class AbstractErrorCode extends Object implements Serializable, ErrorCodeParser, ErrorCode, Cloneable
| Modifier and Type | Field and Description |
|---|---|
protected static String |
DEFAULT_PREFIX
默认错误前缀,TE表示TinyError的意思
|
protected static String |
DEFAULT_VERSION
统一错误规范默认版本
|
protected ErrorLevel |
errorLevel
错误级别,见
ErrorLevels定义 |
protected int |
errorNumber
具体错误码
|
protected String |
errorPrefix
错误前缀
|
protected int |
errorScene
错误场景
|
protected ErrorType |
errorType
错误类型
ErrorTypes定义 |
static int |
LEVEL |
static int |
NUMBER |
static int |
PREFIX |
static int |
SCENE |
static int |
TYPE |
protected String |
version
错误规范版本,错误规范的版本不同,表示某些位数的长度不同
|
static int |
VERSION |
| Constructor and Description |
|---|
AbstractErrorCode() |
AbstractErrorCode(String version,
ErrorType errorType,
ErrorLevel errorLevel,
int errorScene,
int errorNumber,
String errorPrefix) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
assertLength(int field,
String errorPrefix) |
protected abstract String |
getErrorCodeFormatString() |
ErrorLevel |
getErrorLevel() |
int |
getErrorNumber() |
String |
getErrorPrefix() |
int |
getErrorScene() |
ErrorType |
getErrorType() |
protected abstract int[] |
getFieldLength() |
String |
getVersion() |
ErrorCode |
parse(String errorCode)
通过错误码字符串实例化真正的错误码对象
|
void |
setErrorLevel(ErrorLevel errorLevel) |
void |
setErrorNumber(int errorNumber) |
void |
setErrorPrefix(String errorPrefix) |
void |
setErrorScene(int errorScene) |
void |
setErrorType(ErrorType errorType) |
void |
setVersion(String version) |
String |
toString() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitisMatchpublic static final int VERSION
public static final int PREFIX
public static final int TYPE
public static final int LEVEL
public static final int SCENE
public static final int NUMBER
protected static final String DEFAULT_PREFIX
protected static final String DEFAULT_VERSION
protected String errorPrefix
protected String version
protected ErrorType errorType
ErrorTypes定义protected ErrorLevel errorLevel
ErrorLevels定义protected int errorScene
protected int errorNumber
public AbstractErrorCode()
public AbstractErrorCode(String version, ErrorType errorType, ErrorLevel errorLevel, int errorScene, int errorNumber, String errorPrefix)
protected abstract int[] getFieldLength()
protected abstract String getErrorCodeFormatString()
public ErrorCode parse(String errorCode)
ErrorCodeParserparse in interface ErrorCodeParserprotected void assertLength(int field,
String errorPrefix)
public String toString()
toString in class ObjectObject.toString()public String getErrorPrefix()
getErrorPrefix in interface ErrorCodepublic void setErrorPrefix(String errorPrefix)
setErrorPrefix in interface ErrorCodepublic String getVersion()
getVersion in interface ErrorCodepublic void setVersion(String version)
setVersion in interface ErrorCodepublic ErrorType getErrorType()
getErrorType in interface ErrorCodepublic void setErrorType(ErrorType errorType)
setErrorType in interface ErrorCodepublic ErrorLevel getErrorLevel()
getErrorLevel in interface ErrorCodepublic void setErrorLevel(ErrorLevel errorLevel)
setErrorLevel in interface ErrorCodepublic int getErrorScene()
getErrorScene in interface ErrorCodepublic void setErrorScene(int errorScene)
setErrorScene in interface ErrorCodepublic int getErrorNumber()
getErrorNumber in interface ErrorCodepublic void setErrorNumber(int errorNumber)
setErrorNumber in interface ErrorCodeCopyright © 2006–2018 TinyGroup. All rights reserved.