public class ErrorReport
extends java.util.LinkedHashMap
Constructor and Description |
---|
ErrorReport() Constructs an empty ErrorReport |
Modifier and Type | Method and Description |
---|---|
ErrorReport | addError(java.lang.String fieldName, ErrorMessage error) Add a validation error for a field. |
ErrorReport | addError(java.lang.String fieldName, java.lang.String message) Convenience method - creates an ErrorMessage from the passed params and calls addError(fieldName, error). |
ErrorReport | 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 ErrorReport addError(java.lang.String fieldName, java.lang.String message)
fieldName
- fieldName for which to add the errormessage
- set on created ErrorMessagepublic ErrorReport 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 ErrorReport 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