@Internal public abstract class AbstractMessageSet extends Object implements MessageSet
MessageSet.Level, MessageSet.MessageLink
Modifier | Constructor and Description |
---|---|
protected |
AbstractMessageSet(Map<String,MessageSet.MessageLink> errors,
Map<String,MessageSet.MessageLink> warnings,
Set<String> errorsInEnglish,
Set<String> warningsInEnglish) |
Modifier and Type | Method and Description |
---|---|
void |
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 level
|
void |
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 |
equals(Object o) |
Set<String> |
getErrorMessages() |
Set<String> |
getErrorMessagesInEnglish()
Returns a unique set of all the English error messages.
|
MessageSet.MessageLink |
getLinkForError(String errorMsg) |
MessageSet.MessageLink |
getLinkForWarning(String warningMsg) |
Set<String> |
getWarningMessages() |
Set<String> |
getWarningMessagesInEnglish()
Returns a unique set of all the English warning messages.
|
boolean |
hasAnyErrors()
Returns
true if there are error messages, false otherwise. |
boolean |
hasAnyMessages()
Returns
true if there are messages of any type, false otherwise. |
boolean |
hasAnyWarnings()
Returns
true if there are warning messages, false otherwise. |
int |
hashCode() |
String |
toString() |
protected AbstractMessageSet(Map<String,MessageSet.MessageLink> errors, Map<String,MessageSet.MessageLink> warnings, Set<String> errorsInEnglish, Set<String> warningsInEnglish)
public Set<String> getErrorMessages()
getErrorMessages
in interface MessageSet
public Set<String> getErrorMessagesInEnglish()
MessageSet
getErrorMessagesInEnglish
in interface MessageSet
MessageSet.addErrorMessageInEnglish(String)
public Set<String> getWarningMessages()
getWarningMessages
in interface MessageSet
public Set<String> getWarningMessagesInEnglish()
MessageSet
getWarningMessagesInEnglish
in interface MessageSet
MessageSet.addWarningMessageInEnglish(String)
public boolean hasAnyErrors()
MessageSet
true
if there are error messages, false
otherwise.hasAnyErrors
in interface MessageSet
true
if there are error messages, false
otherwise.public boolean hasAnyWarnings()
MessageSet
true
if there are warning messages, false
otherwise.hasAnyWarnings
in interface MessageSet
true
if there are warning messages, false
otherwise.public boolean hasAnyMessages()
MessageSet
true
if there are messages of any type, false
otherwise.
That is, it will return true if hasAnyErrors() is true
or hasAnyWarnings() is true
.hasAnyMessages
in interface MessageSet
true
if there are messages of any type, false
otherwise.public MessageSet.MessageLink getLinkForError(String errorMsg)
getLinkForError
in interface MessageSet
errorMsg
- the unique error messagepublic MessageSet.MessageLink getLinkForWarning(String warningMsg)
getLinkForWarning
in interface MessageSet
warningMsg
- the unique warning messagepublic void addMessageSet(MessageSet messageSet)
MessageSet
addMessageSet
in interface MessageSet
messageSet
- contains the new errors and warnings to add to this set.public void addMessage(MessageSet.Level level, String errorMessage)
MessageSet
addMessage
in interface MessageSet
level
- message levelerrorMessage
- the message to add.public void addMessage(MessageSet.Level level, String errorMessage, MessageSet.MessageLink link)
MessageSet
addMessage
in interface MessageSet
level
- message levelerrorMessage
- the message to add.link
- the link to show the users associated with this error.public void addErrorMessage(String errorMessage)
MessageSet
addErrorMessage
in interface MessageSet
errorMessage
- the message to add.public void addErrorMessage(String errorMessage, MessageSet.MessageLink link)
MessageSet
addErrorMessage
in interface MessageSet
errorMessage
- the message to add.link
- the link to show the users associated with this error.public void addErrorMessageInEnglish(String errorMessage)
MessageSet
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.
addErrorMessageInEnglish
in interface MessageSet
errorMessage
- the message to add.MessageSet.addErrorMessage(String)
,
MessageSet.addWarningMessageInEnglish(String)
public void addWarningMessage(String warningMessage)
MessageSet
addWarningMessage
in interface MessageSet
warningMessage
- the message to add.public void addWarningMessage(String warningMessage, MessageSet.MessageLink link)
MessageSet
addWarningMessage
in interface MessageSet
warningMessage
- the message to add.link
- the link to show the users associated with this warning.public void addWarningMessageInEnglish(String warningMessage)
MessageSet
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.
addWarningMessageInEnglish
in interface MessageSet
warningMessage
- the message to add.MessageSet.addWarningMessage(String)
,
MessageSet.addErrorMessageInEnglish(String)
Copyright © 2002-2017 Atlassian. All Rights Reserved.