Package com.isomorphic.util
Class ErrorReport
- All Implemented Interfaces:
Serializable
,Cloneable
,Map<String,
Object>
Encapsulates a per-record set of validation errors.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddError
(String fieldName, ErrorMessage error) Add a validation error for a field.Convenience method - creates an ErrorMessage from the passed params and calls addError(fieldName, error).Convenience method - creates an ErrorMessage from the passed params and calls addError(fieldName, error).Returns the list of validation errors (ErrorMessages) for a given field.
-
Constructor Details
-
ErrorReport
public ErrorReport()Constructs an empty ErrorReport
-
-
Method Details
-
addError
Convenience method - creates an ErrorMessage from the passed params and calls addError(fieldName, error).- Parameters:
fieldName
- fieldName for which to add the errormessage
- set on created ErrorMessage
-
addError
Convenience method - creates an ErrorMessage from the passed params and calls addError(fieldName, error).- Parameters:
fieldName
- fieldName for which to add the errormessage
- set on created ErrorMessagesuggestedValue
- set on created ErrorMessage
-
addError
Add a validation error for a field.- Parameters:
fieldName
- fieldName for which to add the errorerror
- the error
-
getErrors
Returns the list of validation errors (ErrorMessages) for a given field.- Parameters:
fieldName
- name of the field for which to return validation errors- Returns:
- List of ErrorMessage objects, one for each error
- See Also:
-