Package com.isomorphic.util

# Class ErrorReport

java.lang.Object
java.util.AbstractMap<K,V>
java.util.HashMap<K,V>
java.util.LinkedHashMap<String,Object>
com.isomorphic.util.ErrorReport

All Implemented Interfaces:
  `Serializable`, `Cloneable`, `Map<String,Object>`

public class ErrorReport extends LinkedHashMap<String,Object> implements Serializable
Encapsulates a per-record set of validation errors.

See Also:
  - Serialized Form

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `ErrorReport()`
  Constructs an empty ErrorReport

- ## Method Summary

  Modifier and Type
  Method
  Description
  `ErrorReport`
  `addError(String fieldName, ErrorMessage error)`
  Add a validation error for a field.
  `ErrorReport`
  `addError(String fieldName, String message)`
  Convenience method - creates an ErrorMessage from the passed params and calls addError(fieldName, error).
  `ErrorReport`
  `addError(String fieldName, String message, String suggestedValue)`
  Convenience method - creates an ErrorMessage from the passed params and calls addError(fieldName, error).
  `List`
  `getErrors(String fieldName)`
  Returns the list of validation errors (ErrorMessages) for a given field.

- ## Constructor Details

  - ### ErrorReport

    public ErrorReport()
    Constructs an empty ErrorReport

- ## Method Details

  - ### addError

    public ErrorReport addError(String fieldName, String message)
    Convenience method - creates an ErrorMessage from the passed params and calls addError(fieldName, error).
    Parameters:
      `fieldName` - fieldName for which to add the error
      `message` - set on created ErrorMessage

  - ### addError

    public ErrorReport addError(String fieldName, String message, String suggestedValue)
    Convenience method - creates an ErrorMessage from the passed params and calls addError(fieldName, error).
    Parameters:
      `fieldName` - fieldName for which to add the error
      `message` - set on created ErrorMessage
      `suggestedValue` - set on created ErrorMessage

  - ### addError

    public ErrorReport addError(String fieldName, ErrorMessage error)
    Add a validation error for a field.
    Parameters:
      `fieldName` - fieldName for which to add the error
      `error` - the error

  - ### getErrors

    public List getErrors(String fieldName)
    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:
      - `ErrorMessage`