Package com.exsol.errorcodemodel
Class ErrorIdentifier
- java.lang.Object
-
- com.exsol.errorcodemodel.ErrorIdentifier
-
public final class ErrorIdentifier extends Object
This class represents an Exasol error code (e.g: E-EX-1). Each tag has a type (eg: E), a tag (e.g: EX) and an index (e.g: 1).
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classErrorIdentifier.SyntaxExceptionException that is thrown on syntax errors in theErrorIdentifier.static classErrorIdentifier.TypePossible types of Exasol error codes.
-
Constructor Summary
Constructors Constructor Description ErrorIdentifier(ErrorIdentifier.Type type, String tag, int index)Create a new instance of anErrorIdentifier.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object other)intgetIndex()Get the error code index.StringgetTag()Get the error code tag.ErrorIdentifier.TypegetType()Get the error type.inthashCode()static ErrorIdentifierparse(String errorCode)Parse an error identifier string.StringtoString()
-
-
-
Constructor Detail
-
ErrorIdentifier
public ErrorIdentifier(ErrorIdentifier.Type type, String tag, int index)
Create a new instance of anErrorIdentifier.- Parameters:
type- type of error (e.g. warning, error, fatal)tag- error tagindex- index number of the error
-
-
Method Detail
-
parse
public static ErrorIdentifier parse(String errorCode) throws ErrorIdentifier.SyntaxException
Parse an error identifier string.Example:
E-TEST-1- Parameters:
errorCode- error identifier string- Returns:
- parsed
ErrorIdentifier - Throws:
ErrorIdentifier.SyntaxException- if the code has an invalid syntax
-
getType
public ErrorIdentifier.Type getType()
Get the error type.- Returns:
- type of the error
-
getTag
public String getTag()
Get the error code tag.- Returns:
- error code tag
-
getIndex
public int getIndex()
Get the error code index.- Returns:
- error code index.
-
-