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, wait
isMatch
public 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)
ErrorCodeParser
parse
in interface ErrorCodeParser
protected void assertLength(int field, String errorPrefix)
public String toString()
toString
in class Object
Object.toString()
public String getErrorPrefix()
getErrorPrefix
in interface ErrorCode
public void setErrorPrefix(String errorPrefix)
setErrorPrefix
in interface ErrorCode
public String getVersion()
getVersion
in interface ErrorCode
public void setVersion(String version)
setVersion
in interface ErrorCode
public ErrorType getErrorType()
getErrorType
in interface ErrorCode
public void setErrorType(ErrorType errorType)
setErrorType
in interface ErrorCode
public ErrorLevel getErrorLevel()
getErrorLevel
in interface ErrorCode
public void setErrorLevel(ErrorLevel errorLevel)
setErrorLevel
in interface ErrorCode
public int getErrorScene()
getErrorScene
in interface ErrorCode
public void setErrorScene(int errorScene)
setErrorScene
in interface ErrorCode
public int getErrorNumber()
getErrorNumber
in interface ErrorCode
public void setErrorNumber(int errorNumber)
setErrorNumber
in interface ErrorCode
Copyright © 2006–2018 TinyGroup. All rights reserved.