Package com.yahoo.protect
Class ErrorMessage
java.lang.Object
com.yahoo.protect.ErrorMessage
An error message with a code.
This class should be treated as immutable.
- Author:
- bratseth
-
Field Summary
-
Constructor Summary
ConstructorDescriptionCreate an invalid instance for a subclass to initialize.ErrorMessage
(int code, String message) ErrorMessage
(int code, String message, String detailedMessage) Create an application specific error message with an application specific codeErrorMessage
(int code, String message, String detailedMessage, Throwable cause) Create an application specific error message with an application specific code -
Method Summary
Modifier and TypeMethodDescriptionboolean
Two error messages are equal if they have the same code and message.getCause()
Returns the cause of this, or null if none is setint
getCode()
Returns the detailed message, or null if there is no detailed messageint
hashCode()
void
Sets the cause of this.toString()
-
Field Details
-
code
protected int codeAn error code -
message
The short message of this error, always set -
detailedMessage
The detailed instance message of this error, not always set -
cause
The cause of this error, or null if none is recorded
-
-
Constructor Details
-
ErrorMessage
public ErrorMessage()Create an invalid instance for a subclass to initialize. -
ErrorMessage
-
ErrorMessage
Create an application specific error message with an application specific code -
ErrorMessage
Create an application specific error message with an application specific code
-
-
Method Details
-
getCode
public int getCode() -
getMessage
-
getDetailedMessage
Returns the detailed message, or null if there is no detailed message -
setCause
Sets the cause of this. This should be set on errors which likely have their origin in plugin component code, not on others. -
getCause
Returns the cause of this, or null if none is set -
hashCode
public int hashCode() -
equals
Two error messages are equal if they have the same code and message. The cause is ignored in the comparison. -
toString
-