Package com.appiancorp.suiteapi.common
Class ValidationItem
java.lang.Object
com.appiancorp.suiteapi.common.ValidationItem
A
ValidationItem associates a ValidationCode to
the the supplied parameters. A call to getMessage(Locale) returns
the message associated with the ValidationCode passing the
parameters to the ValidationCode#getMessage(Locale, Object[]) method.
ValidationItems are to ValidationCodes what
ErrorCodes are to AppianExceptions (a transport mechanism
for AppianErrorCode)-
Constructor Summary
ConstructorsConstructorDescriptionValidationItem(ValidationCode code) ValidationItem(ValidationCode validationCode, Object... validationCodeParams) -
Method Summary
Modifier and TypeMethodDescriptionbooleangetMessage(Locale locale) Returns this validation items's message representation.getMessageWithValidationCode(Locale locale) Returns this validation items's default message representation with validation code information.Gets the validation code that must be used to render this validation items's message representation.Object[]Gets the arguments that must be used to render this validation items's message representation.inthashCode()toString()Could be used for logging
-
Constructor Details
-
ValidationItem
-
ValidationItem
-
-
Method Details
-
getValidationCode
Gets the validation code that must be used to render this validation items's message representation.- Returns:
- the validation code tied to this validation item
-
getValidationCodeParams
Gets the arguments that must be used to render this validation items's message representation.- Returns:
- the arguments of the validation code tied to this validation item
-
getMessage
Returns this validation items's message representation. This method should be used whenever the message is to be displayed to the end user. The default representation do not include any validation code information because this may be rendered in different ways across the application. If needed, the validation items's validation code can be retrieved fromgetValidationCode().- Parameters:
locale- message's locale- Returns:
- this validation item's message representation
- See Also:
-
getMessageWithValidationCode
Returns this validation items's default message representation with validation code information. This method could be used whenever the message is to be displayed to the end user. Although the default representationgetMessage(Locale)does not include any error code information, as the representation could vary in different ways across the application, this method provides a utility for a representation with validation code. Be sure while using this method as the requirements could vary, in which case usegetMessage(Locale)in conjunction withgetValidationCode().- Parameters:
locale- message's locale- Returns:
- this validation items's default message representation with validation code
- See Also:
-
toString
Could be used for logging -
equals
-
hashCode
public int hashCode()
-