Package com.atlassian.jira.util
Class AbstractMessageSet
java.lang.Object
com.atlassian.jira.util.AbstractMessageSet
- All Implemented Interfaces:
MessageSet
,Serializable
- Direct Known Subclasses:
ListOrderedMessageSetImpl
,MessageSetImpl
Base class for the message set.
- Since:
- v3.13
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.atlassian.jira.util.MessageSet
MessageSet.Level, MessageSet.MessageLink
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
AbstractMessageSet
(Map<String, MessageSet.MessageLink> errors, Map<String, MessageSet.MessageLink> warnings, Set<String> errorsInEnglish, Set<String> warningsInEnglish) -
Method Summary
Modifier and TypeMethodDescriptionvoid
addErrorMessage
(String errorMessage) Adds an error message.void
addErrorMessage
(String errorMessage, MessageSet.MessageLink link) Adds an error message and associates a link with the error.void
addErrorMessageInEnglish
(String errorMessage) Adds an error message in English.void
addMessage
(MessageSet.Level level, String errorMessage) Adds a message with the given warning / error levelvoid
addMessage
(MessageSet.Level level, String errorMessage, MessageSet.MessageLink link) Adds an error message with the given warning / error level and associates a link with the error.void
addMessageSet
(MessageSet messageSet) Will concatenate this message set with the provided message set.void
addWarningMessage
(String warningMessage) Adds a warning message.void
addWarningMessage
(String warningMessage, MessageSet.MessageLink link) Adds a warning message and associates a link with the warning.void
addWarningMessageInEnglish
(String warningMessage) Adds a warning message in English.boolean
Returns a unique set of all the English error messages.getLinkForError
(String errorMsg) getLinkForWarning
(String warningMsg) Returns a unique set of all the English warning messages.boolean
Returnstrue
if there are error messages,false
otherwise.boolean
Returnstrue
if there are messages of any type,false
otherwise.boolean
Returnstrue
if there are warning messages,false
otherwise.int
hashCode()
toString()
-
Constructor Details
-
AbstractMessageSet
protected AbstractMessageSet(Map<String, MessageSet.MessageLink> errors, Map<String, MessageSet.MessageLink> warnings, Set<String> errorsInEnglish, Set<String> warningsInEnglish)
-
-
Method Details
-
getErrorMessages
- Specified by:
getErrorMessages
in interfaceMessageSet
- Returns:
- a unique set of error messages, these messages are separate from the warning messages, never null.
-
getErrorMessagesInEnglish
Description copied from interface:MessageSet
Returns a unique set of all the English error messages.- Specified by:
getErrorMessagesInEnglish
in interfaceMessageSet
- Returns:
- a unique set of all the English error messages.
- See Also:
-
getWarningMessages
- Specified by:
getWarningMessages
in interfaceMessageSet
- Returns:
- a unique set of warning messages, these messages are separate from the error messages, never null.
-
getWarningMessagesInEnglish
Description copied from interface:MessageSet
Returns a unique set of all the English warning messages.- Specified by:
getWarningMessagesInEnglish
in interfaceMessageSet
- Returns:
- a unique set of all the English warning messages.
- See Also:
-
hasAnyErrors
public boolean hasAnyErrors()Description copied from interface:MessageSet
Returnstrue
if there are error messages,false
otherwise.- Specified by:
hasAnyErrors
in interfaceMessageSet
- Returns:
true
if there are error messages,false
otherwise.
-
hasAnyWarnings
public boolean hasAnyWarnings()Description copied from interface:MessageSet
Returnstrue
if there are warning messages,false
otherwise.- Specified by:
hasAnyWarnings
in interfaceMessageSet
- Returns:
true
if there are warning messages,false
otherwise.
-
hasAnyMessages
public boolean hasAnyMessages()Description copied from interface:MessageSet
Returnstrue
if there are messages of any type,false
otherwise. That is, it will return true if hasAnyErrors() istrue
or hasAnyWarnings() istrue
.- Specified by:
hasAnyMessages
in interfaceMessageSet
- Returns:
true
if there are messages of any type,false
otherwise.
-
getLinkForError
- Specified by:
getLinkForError
in interfaceMessageSet
- Parameters:
errorMsg
- the unique error message- Returns:
- the MessageLink that is associated with the error, if one exists, null otherwise.
-
getLinkForWarning
- Specified by:
getLinkForWarning
in interfaceMessageSet
- Parameters:
warningMsg
- the unique warning message- Returns:
- the MessageLink that is associated with the warning, if one exists, null otherwise.
-
addMessageSet
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 interfaceMessageSet
- Parameters:
messageSet
- contains the new errors and warnings to add to this set.
-
addMessage
Description copied from interface:MessageSet
Adds a message with the given warning / error level- Specified by:
addMessage
in interfaceMessageSet
- Parameters:
level
- message levelerrorMessage
- the message to add.
-
addMessage
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 interfaceMessageSet
- Parameters:
level
- message levelerrorMessage
- the message to add.link
- the link to show the users associated with this error.
-
addErrorMessage
Description copied from interface:MessageSet
Adds an error message.- Specified by:
addErrorMessage
in interfaceMessageSet
- Parameters:
errorMessage
- the message to add.
-
addErrorMessage
Description copied from interface:MessageSet
Adds an error message and associates a link with the error.- Specified by:
addErrorMessage
in interfaceMessageSet
- Parameters:
errorMessage
- the message to add.link
- the link to show the users associated with this error.
-
addErrorMessageInEnglish
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 interfaceMessageSet
- Parameters:
errorMessage
- the message to add.- See Also:
-
addWarningMessage
Description copied from interface:MessageSet
Adds a warning message.- Specified by:
addWarningMessage
in interfaceMessageSet
- Parameters:
warningMessage
- the message to add.
-
addWarningMessage
Description copied from interface:MessageSet
Adds a warning message and associates a link with the warning.- Specified by:
addWarningMessage
in interfaceMessageSet
- Parameters:
warningMessage
- the message to add.link
- the link to show the users associated with this warning.
-
addWarningMessageInEnglish
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 interfaceMessageSet
- Parameters:
warningMessage
- the message to add.- See Also:
-
equals
-
hashCode
public int hashCode() -
toString
-