Class AbstractMessageSet

java.lang.Object
com.atlassian.jira.util.AbstractMessageSet
All Implemented Interfaces:
MessageSet, Serializable
Direct Known Subclasses:
ListOrderedMessageSetImpl, MessageSetImpl

@Internal public abstract class AbstractMessageSet extends Object implements MessageSet
Base class for the message set.
Since:
v3.13
See Also:
  • Constructor Details

  • Method Details

    • getErrorMessages

      public Set<String> getErrorMessages()
      Specified by:
      getErrorMessages in interface MessageSet
      Returns:
      a unique set of error messages, these messages are separate from the warning messages, never null.
    • getErrorMessagesInEnglish

      public Set<String> getErrorMessagesInEnglish()
      Description copied from interface: MessageSet
      Returns a unique set of all the English error messages.
      Specified by:
      getErrorMessagesInEnglish in interface MessageSet
      Returns:
      a unique set of all the English error messages.
      See Also:
    • getWarningMessages

      public Set<String> getWarningMessages()
      Specified by:
      getWarningMessages in interface MessageSet
      Returns:
      a unique set of warning messages, these messages are separate from the error messages, never null.
    • getWarningMessagesInEnglish

      public Set<String> getWarningMessagesInEnglish()
      Description copied from interface: MessageSet
      Returns a unique set of all the English warning messages.
      Specified by:
      getWarningMessagesInEnglish in interface MessageSet
      Returns:
      a unique set of all the English warning messages.
      See Also:
    • hasAnyErrors

      public boolean hasAnyErrors()
      Description copied from interface: MessageSet
      Returns true if there are error messages, false otherwise.
      Specified by:
      hasAnyErrors in interface MessageSet
      Returns:
      true if there are error messages, false otherwise.
    • hasAnyWarnings

      public boolean hasAnyWarnings()
      Description copied from interface: MessageSet
      Returns true if there are warning messages, false otherwise.
      Specified by:
      hasAnyWarnings in interface MessageSet
      Returns:
      true if there are warning messages, false otherwise.
    • hasAnyMessages

      public boolean hasAnyMessages()
      Description copied from interface: MessageSet
      Returns true if there are messages of any type, false otherwise. That is, it will return true if hasAnyErrors() is true or hasAnyWarnings() is true.
      Specified by:
      hasAnyMessages in interface MessageSet
      Returns:
      true if there are messages of any type, false otherwise.
    • getLinkForError

      public MessageSet.MessageLink getLinkForError(String errorMsg)
      Specified by:
      getLinkForError in interface MessageSet
      Parameters:
      errorMsg - the unique error message
      Returns:
      the MessageLink that is associated with the error, if one exists, null otherwise.
    • getLinkForWarning

      public MessageSet.MessageLink getLinkForWarning(String warningMsg)
      Specified by:
      getLinkForWarning in interface MessageSet
      Parameters:
      warningMsg - the unique warning message
      Returns:
      the MessageLink that is associated with the warning, if one exists, null otherwise.
    • addMessageSet

      public void addMessageSet(MessageSet messageSet)
      Description copied from interface: MessageSet
      Will concatenate this message set with the provided message set. All new errors and warnings will be added to the existing errors and warnings.
      Specified by:
      addMessageSet in interface MessageSet
      Parameters:
      messageSet - contains the new errors and warnings to add to this set.
    • addMessage

      public void addMessage(MessageSet.Level level, String errorMessage)
      Description copied from interface: MessageSet
      Adds a message with the given warning / error level
      Specified by:
      addMessage in interface MessageSet
      Parameters:
      level - message level
      errorMessage - the message to add.
    • addMessage

      public void addMessage(MessageSet.Level level, String errorMessage, MessageSet.MessageLink link)
      Description copied from interface: MessageSet
      Adds an error message with the given warning / error level and associates a link with the error.
      Specified by:
      addMessage in interface MessageSet
      Parameters:
      level - message level
      errorMessage - the message to add.
      link - the link to show the users associated with this error.
    • addErrorMessage

      public void addErrorMessage(String errorMessage)
      Description copied from interface: MessageSet
      Adds an error message.
      Specified by:
      addErrorMessage in interface MessageSet
      Parameters:
      errorMessage - the message to add.
    • addErrorMessage

      public void addErrorMessage(String errorMessage, MessageSet.MessageLink link)
      Description copied from interface: MessageSet
      Adds an error message and associates a link with the error.
      Specified by:
      addErrorMessage in interface MessageSet
      Parameters:
      errorMessage - the message to add.
      link - the link to show the users associated with this error.
    • addErrorMessageInEnglish

      public void addErrorMessageInEnglish(String errorMessage)
      Description copied from interface: MessageSet
      Adds an error message in English.

      This is useful when the MessageSet.addErrorMessage(String) method is used to add translated messages, and you want to be able to get a set of the messages in English as well. Eg, in the Project Import we show the translated messages on screen during validation, and log the English versions in case Atlassian Support needs to read the logs later.

      Specified by:
      addErrorMessageInEnglish in interface MessageSet
      Parameters:
      errorMessage - the message to add.
      See Also:
    • addWarningMessage

      public void addWarningMessage(String warningMessage)
      Description copied from interface: MessageSet
      Adds a warning message.
      Specified by:
      addWarningMessage in interface MessageSet
      Parameters:
      warningMessage - the message to add.
    • addWarningMessage

      public void addWarningMessage(String warningMessage, MessageSet.MessageLink link)
      Description copied from interface: MessageSet
      Adds a warning message and associates a link with the warning.
      Specified by:
      addWarningMessage in interface MessageSet
      Parameters:
      warningMessage - the message to add.
      link - the link to show the users associated with this warning.
    • addWarningMessageInEnglish

      public void addWarningMessageInEnglish(String warningMessage)
      Description copied from interface: MessageSet
      Adds a warning message in English.

      This is useful when the MessageSet.addWarningMessage(String) method is used to add translated messages, and you want to be able to get a set of the messages in English as well. Eg, in the Project Import we show the translated messages on screen during validation, and log the English versions in case Atlassian Support needs to read the logs later.

      Specified by:
      addWarningMessageInEnglish in interface MessageSet
      Parameters:
      warningMessage - the message to add.
      See Also:
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object