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
ConstructorsModifierConstructorDescriptionprotectedAbstractMessageSet(Map<String, MessageSet.MessageLink> errors, Map<String, MessageSet.MessageLink> warnings, Set<String> errorsInEnglish, Set<String> warningsInEnglish) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddErrorMessage(String errorMessage) Adds an error message.voidaddErrorMessage(String errorMessage, MessageSet.MessageLink link) Adds an error message and associates a link with the error.voidaddErrorMessageInEnglish(String errorMessage) Adds an error message in English.voidaddMessage(MessageSet.Level level, String errorMessage) Adds a message with the given warning / error levelvoidaddMessage(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.voidaddMessageSet(MessageSet messageSet) Will concatenate this message set with the provided message set.voidaddWarningMessage(String warningMessage) Adds a warning message.voidaddWarningMessage(String warningMessage, MessageSet.MessageLink link) Adds a warning message and associates a link with the warning.voidaddWarningMessageInEnglish(String warningMessage) Adds a warning message in English.booleanReturns 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.booleanReturnstrueif there are error messages,falseotherwise.booleanReturnstrueif there are messages of any type,falseotherwise.booleanReturnstrueif there are warning messages,falseotherwise.inthashCode()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:
getErrorMessagesin interfaceMessageSet- Returns:
- a unique set of error messages, these messages are separate from the warning messages, never null.
-
getErrorMessagesInEnglish
Description copied from interface:MessageSetReturns a unique set of all the English error messages.- Specified by:
getErrorMessagesInEnglishin interfaceMessageSet- Returns:
- a unique set of all the English error messages.
- See Also:
-
getWarningMessages
- Specified by:
getWarningMessagesin interfaceMessageSet- Returns:
- a unique set of warning messages, these messages are separate from the error messages, never null.
-
getWarningMessagesInEnglish
Description copied from interface:MessageSetReturns a unique set of all the English warning messages.- Specified by:
getWarningMessagesInEnglishin interfaceMessageSet- Returns:
- a unique set of all the English warning messages.
- See Also:
-
hasAnyErrors
public boolean hasAnyErrors()Description copied from interface:MessageSetReturnstrueif there are error messages,falseotherwise.- Specified by:
hasAnyErrorsin interfaceMessageSet- Returns:
trueif there are error messages,falseotherwise.
-
hasAnyWarnings
public boolean hasAnyWarnings()Description copied from interface:MessageSetReturnstrueif there are warning messages,falseotherwise.- Specified by:
hasAnyWarningsin interfaceMessageSet- Returns:
trueif there are warning messages,falseotherwise.
-
hasAnyMessages
public boolean hasAnyMessages()Description copied from interface:MessageSetReturnstrueif there are messages of any type,falseotherwise. That is, it will return true if hasAnyErrors() istrueor hasAnyWarnings() istrue.- Specified by:
hasAnyMessagesin interfaceMessageSet- Returns:
trueif there are messages of any type,falseotherwise.
-
getLinkForError
- Specified by:
getLinkForErrorin interfaceMessageSet- Parameters:
errorMsg- the unique error message- Returns:
- the MessageLink that is associated with the error, if one exists, null otherwise.
-
getLinkForWarning
- Specified by:
getLinkForWarningin 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:MessageSetWill 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:
addMessageSetin interfaceMessageSet- Parameters:
messageSet- contains the new errors and warnings to add to this set.
-
addMessage
Description copied from interface:MessageSetAdds a message with the given warning / error level- Specified by:
addMessagein interfaceMessageSet- Parameters:
level- message levelerrorMessage- the message to add.
-
addMessage
Description copied from interface:MessageSetAdds an error message with the given warning / error level and associates a link with the error.- Specified by:
addMessagein 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:MessageSetAdds an error message.- Specified by:
addErrorMessagein interfaceMessageSet- Parameters:
errorMessage- the message to add.
-
addErrorMessage
Description copied from interface:MessageSetAdds an error message and associates a link with the error.- Specified by:
addErrorMessagein interfaceMessageSet- Parameters:
errorMessage- the message to add.link- the link to show the users associated with this error.
-
addErrorMessageInEnglish
Description copied from interface:MessageSetAdds 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:
addErrorMessageInEnglishin interfaceMessageSet- Parameters:
errorMessage- the message to add.- See Also:
-
addWarningMessage
Description copied from interface:MessageSetAdds a warning message.- Specified by:
addWarningMessagein interfaceMessageSet- Parameters:
warningMessage- the message to add.
-
addWarningMessage
Description copied from interface:MessageSetAdds a warning message and associates a link with the warning.- Specified by:
addWarningMessagein interfaceMessageSet- Parameters:
warningMessage- the message to add.link- the link to show the users associated with this warning.
-
addWarningMessageInEnglish
Description copied from interface:MessageSetAdds 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:
addWarningMessageInEnglishin interfaceMessageSet- Parameters:
warningMessage- the message to add.- See Also:
-
equals
-
hashCode
public int hashCode() -
toString
-