Class ErrorInfo
- java.lang.Object
-
- org.openehealth.ipf.commons.ihe.xds.core.responses.ErrorInfo
-
- All Implemented Interfaces:
Serializable
public class ErrorInfo extends Object implements Serializable
Contains information about an error. All members of this class are allowed to benull
.- Author:
- Jens Riemschneider
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description ErrorInfo()
Constructs an error info.ErrorInfo(Throwable throwable, ErrorCode defaultMetaDataError, ErrorCode defaultError, String defaultLocation)
Constructs an error info from the given exception.ErrorInfo(ErrorCode errorCode, String codeContext, Severity severity, String location, String customErrorCode)
Constructs an error info.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object obj)
String
getCodeContext()
String
getCustomErrorCode()
ErrorCode
getErrorCode()
String
getLocation()
Severity
getSeverity()
int
hashCode()
void
setCodeContext(String codeContext)
void
setCustomErrorCode(String customErrorCode)
void
setErrorCode(ErrorCode errorCode)
void
setLocation(String location)
void
setSeverity(Severity severity)
String
toString()
-
-
-
Constructor Detail
-
ErrorInfo
public ErrorInfo()
Constructs an error info.
-
ErrorInfo
public ErrorInfo(ErrorCode errorCode, String codeContext, Severity severity, String location, String customErrorCode)
Constructs an error info.- Parameters:
errorCode
- the error that occurred.codeContext
- the context in which the error occurred.severity
- the severity of the error.location
- the location in which the error occurred.customErrorCode
- user-defined error code for the cases when theerrorCode
parameter equals toErrorCode._USER_DEFINED
, otherwise will be ignored.
-
ErrorInfo
public ErrorInfo(Throwable throwable, ErrorCode defaultMetaDataError, ErrorCode defaultError, String defaultLocation)
Constructs an error info from the given exception.- Parameters:
throwable
- the exception that occurred.defaultMetaDataError
- the default error code forXDSMetaDataException
.defaultError
- the default error code for any other exception.defaultLocation
- default error location.
-
-
Method Detail
-
getErrorCode
public ErrorCode getErrorCode()
- Returns:
- the error that occurred.
-
setErrorCode
public void setErrorCode(ErrorCode errorCode)
- Parameters:
errorCode
- the error that occurred.
-
getCodeContext
public String getCodeContext()
- Returns:
- the context in which the error occurred.
-
setCodeContext
public void setCodeContext(String codeContext)
- Parameters:
codeContext
- the context in which the error occurred.
-
getSeverity
public Severity getSeverity()
- Returns:
- the severity of the error.
-
setSeverity
public void setSeverity(Severity severity)
- Parameters:
severity
- the severity of the error.
-
getLocation
public String getLocation()
- Returns:
- the location in which the error occurred.
-
setLocation
public void setLocation(String location)
- Parameters:
location
- the location in which the error occurred.
-
getCustomErrorCode
public String getCustomErrorCode()
- Returns:
- custom error code, if any set.
-
setCustomErrorCode
public void setCustomErrorCode(String customErrorCode)
-
-