@PublicApi public interface MessageSet extends Serializable
Modifier and Type | Interface and Description |
---|---|
static class |
MessageSet.Level
Message levels
|
static class |
MessageSet.MessageLink
A simple class for holding link text and a link url.
|
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.
|
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. |
Set<String> getErrorMessages()
MessageSet.MessageLink getLinkForError(String errorMsg)
errorMsg
- the unique error messageSet<String> getErrorMessagesInEnglish()
addErrorMessageInEnglish(String)
Set<String> getWarningMessages()
MessageSet.MessageLink getLinkForWarning(String warningMsg)
warningMsg
- the unique warning messageSet<String> getWarningMessagesInEnglish()
addWarningMessageInEnglish(String)
boolean hasAnyErrors()
true
if there are error messages, false
otherwise.true
if there are error messages, false
otherwise.boolean hasAnyWarnings()
true
if there are warning messages, false
otherwise.true
if there are warning messages, false
otherwise.boolean hasAnyMessages()
true
if there are messages of any type, false
otherwise.
That is, it will return true if hasAnyErrors() is true
or hasAnyWarnings() is true
.true
if there are messages of any type, false
otherwise.void addMessageSet(MessageSet messageSet)
messageSet
- contains the new errors and warnings to add to this set.void addMessage(MessageSet.Level level, String errorMessage)
level
- message levelerrorMessage
- the message to add.void addMessage(MessageSet.Level level, String errorMessage, MessageSet.MessageLink link)
level
- message levelerrorMessage
- the message to add.link
- the link to show the users associated with this error.void addErrorMessage(String errorMessage)
errorMessage
- the message to add.void addErrorMessage(String errorMessage, MessageSet.MessageLink link)
errorMessage
- the message to add.link
- the link to show the users associated with this error.void addErrorMessageInEnglish(String errorMessage)
This is useful when the 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.
errorMessage
- the message to add.addErrorMessage(String)
,
addWarningMessageInEnglish(String)
void addWarningMessage(String warningMessage)
warningMessage
- the message to add.void addWarningMessage(String warningMessage, MessageSet.MessageLink link)
warningMessage
- the message to add.link
- the link to show the users associated with this warning.void addWarningMessageInEnglish(String warningMessage)
This is useful when the 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.
warningMessage
- the message to add.addWarningMessage(String)
,
addErrorMessageInEnglish(String)
Copyright © 2002-2021 Atlassian. All Rights Reserved.