Interface ErrorCollection

    • Method Detail

      • addError

        void addError​(String field,
                      String message)
        Add a field-specific error message.
        field - Field name, eg. "assignee"
        message - Error message.
      • addError

        void addError​(String prefix,
                      String field,
                      String message)
        Adds a new form validation error with a given prefix. ie. prefix of "builder.ant" and field "target" will result in a key of ""
        prefix - The prefix of the field in . form
        field - The id of the form element in error
        message - The error message to display to the user
      • addErrorMessage

        String addErrorMessage​(String message)
        Add error message relating to system state (not field-specific).
        message - Error message.
      • getErrorMessages

        Collection<String> getErrorMessages()
        Get all non field-specific error messages.
        Collection of error Strings.
      • setErrorMessages

        void setErrorMessages​(Collection<String> errorMessages)
        Populate this ErrorCollection with a new set of messages (existing errors are lost).
        errorMessages - List of error message Strings.
      • getFlushedErrorMessages

        Collection<String> getFlushedErrorMessages()
        Get error messages, then get rid of them.
        The (now cleared) error messages.
      • getErrors

        Map<String,​List<String>> getErrors()
        Get all field-specific errors.
        Map of String: String pairs, eg. {"assignee": "Assignee is required"}
      • addErrorCollection

        void addErrorCollection​(@NotNull
                                @NotNull ErrorCollection errors)
        Populate this ErrorCollection with general and field-specific errors.
        errors - ErrorCollection whose errors/messages we obtain.
      • addErrorMessages

        void addErrorMessages​(Collection<String> errorMessages)
        Append new error messages to those already collected.
        errorMessages - Collection of error strings.
      • addFieldErrors

        void addFieldErrors​(Map<String,​List<String>> errors)
        Append new field-specific errors to those already collected.
        errors - A Map from String field names, to String error messages, or Collections of String error messages.
      • hasAnyErrors

        boolean hasAnyErrors()
        Whether any errors (of any type - field-specific or otherwise) have been collected.
        true if there are errors; false otherwise.
      • getTotalErrors

        int getTotalErrors()
      • getAllErrorMessages

        default @NotNull List<String> getAllErrorMessages()
        Get all error messages from this error collection. Includes error messages and field errors. Field names are skipped.