Interface ErrorCollection

All Known Implementing Classes:
ErrorCollectionImpl, NestedErrorCollection

public interface ErrorCollection
Interface for handling errors
  • Method Details

    • hasAnyErrors

      boolean hasAnyErrors()
      Does this contain any field errors or messages
    • addErrors

      ErrorCollection addErrors(ErrorCollection errorCollection)
      Appends error messages and add the error map. This over-writes the errors map for any duplicate key Warning: This method does not currently copy across error status, ensure that it set properly before using this
    • addErrors

      ErrorCollection addErrors(Map<String,Object> fieldErrorMap)
    • addError

      ErrorCollection addError(String field, Object error)
      Adds to the error map. This over-writes for any duplicate key
    • getErrors

      Map<String,Object> getErrors()
      Error key/values on the collection
      Returns:
      Unmodified map of errors. Use addError for any mutations
    • addErrorMessage

      ErrorCollection addErrorMessage(String errorMessage)
      Appends error message
    • addErrorMessages

      ErrorCollection addErrorMessages(Collection<String> messages)
    • addWarningMessages

      ErrorCollection addWarningMessages(Collection<String> messages)
    • getErrorMessages

      List<String> getErrorMessages()
    • getWarningMessages

      List<String> getWarningMessages()
    • getErrorMessage

      String getErrorMessage()
      Returns an error message, this is only set through JSON
    • setStatus

      void setStatus(int status)
      Sets the HTTP status code for the error
    • getStatus

      int getStatus()
    • newInstance

      static ErrorCollection newInstance()