public class ErrorReport
Constructor and Description |
---|
ErrorReport() Constructs an empty ErrorReport |
Modifier and Type | Method and Description |
---|---|
void | addError(java.lang.String fieldName, ErrorMessage error) Add a validation error for a field. |
void | addError(java.lang.String fieldName, java.lang.String message) Convenience method - creates an ErrorMessage from the passed params and calls addError(fieldName, error). |
void | addError(java.lang.String fieldName, java.lang.String message, java.lang.String suggestedValue) Convenience method - creates an ErrorMessage from the passed params and calls addError(fieldName, error). |
java.util.List | getErrors(java.lang.String fieldName) Returns the list of validation errors (ErrorMessages) for a given field. |
public void addError(java.lang.String fieldName, java.lang.String message)
fieldName
- fieldName for which to add the errormessage
- set on created ErrorMessagepublic void addError(java.lang.String fieldName, java.lang.String message, java.lang.String suggestedValue)
fieldName
- fieldName for which to add the errormessage
- set on created ErrorMessagesuggestedValue
- set on created ErrorMessagepublic void addError(java.lang.String fieldName, ErrorMessage error)
fieldName
- fieldName for which to add the errorerror
- the errorpublic java.util.List getErrors(java.lang.String fieldName)
fieldName
- name of the field for which to return validation errorsErrorMessage