Class ErrorCode
java.lang.Object
com.aquima.interactions.foundation.report.ErrorCode
- All Implemented Interfaces:
Serializable
,Comparable<ErrorCode>
- Direct Known Subclasses:
ContentErrorCode
,ElementErrorCode
,RuleErrorCode
,TypedErrorCode
,UntypedErrorCode
This class identified an error.
- Since:
- 5.0
- Author:
- F. van der Meer, Jon van Leuven, O. Kerpershoek
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionint
create()
This method creates and returns the message for this code without any parameters.createWith
(Object parameter1) This method creates and returns the message for this code with a single parameter.createWith
(Object parameter1, Object parameter2) This method creates and returns the message for this code with two parameter.createWith
(Object parameter1, Object parameter2, Object parameter3) This method creates and returns the message for this code with three parameter.createWith
(String[] parameters) This method creates and returns the message for this code with an array parameters.boolean
getCode()
This method returns the unique error code ID of this object.protected abstract String
getElementName
(Map<String, String> blamedElements) protected abstract String
getElementType
(Map<String, String> blamedElements) getEnglishText
(String[] parameters) This method returns the error message text with the provided parameters substituted in the message.This method returns the error message text without any parameter substitution.int
This method returns the number of parameters that should be supplied.String[]
This method returns the names of the parameters that should be provided for the error message.int
hashCode()
protected boolean
toString()
-
Constructor Details
-
ErrorCode
Constructs an error definition with a code which should be unique and a default English text. The English text allows parameters which can be inserted. Example:new ErrorCode( "myuniqueId", "The message came from {0}" );
- Parameters:
code
- Unique code for the error.englishText
- An explanation text for the error, optionally containing parameters.parameterNames
- Array of strings containing the names of the parameters.
-
-
Method Details
-
getElementType
-
getElementName
-
isTyped
-
getCode
This method returns the unique error code ID of this object.- Returns:
- the unique error code ID of this object.
-
getEnglishText
This method returns the error message text with the provided parameters substituted in the message.- Parameters:
parameters
- The parameter values that should be used in the error message.- Returns:
- the error message text with the provided parameters substituted in the message.
-
getInternalText
This method returns the error message text without any parameter substitution.- Returns:
- the error message text without any parameter substitution.
-
getParameterCount
public int getParameterCount()This method returns the number of parameters that should be supplied.- Returns:
- the number of parameters that should be supplied.
-
getParameterNames
This method returns the names of the parameters that should be provided for the error message.- Returns:
- the names of the parameters that should be provided for the error message.
-
compareTo
- Specified by:
compareTo
in interfaceComparable<ErrorCode>
-
equals
-
hashCode
public int hashCode() -
toString
-
createWith
This method creates and returns the message for this code with an array parameters.- Parameters:
parameters
- Array containing the values for the parameters.- Returns:
- the message for this code with an array parameters.
-
createWith
This method creates and returns the message for this code with a single parameter.- Parameters:
parameter1
- The parameter that should be substituted in the message.- Returns:
- the message for this code.
-
createWith
This method creates and returns the message for this code with two parameter.- Parameters:
parameter1
- The first parameter that should be substituted in the message.parameter2
- The second parameter that should be substituted in the message.- Returns:
- the message for this code.
-
createWith
This method creates and returns the message for this code with three parameter.- Parameters:
parameter1
- The first parameter that should be substituted in the message.parameter2
- The second parameter that should be substituted in the message.parameter3
- The third parameter that should be substituted in the message.- Returns:
- the message for this code.
-
create
This method creates and returns the message for this code without any parameters.- Returns:
- the message for this code without any parameters.
-