Class Messages
java.lang.Object
org.ctan.site.services.upload.util.Messages
This class is a container for messages. The messages may have the type
ERROR, WARNING, or INFO.-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final longThe fieldserialVersionUIDcontains the version number. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionThis method adds an error message with the given parameters.static MessageserrorMessage(String... msg) The methoderrorMessageprovides means to create a new Messages instance populated with an error.errorOrWarning(String... msg) This method adds an error message with the given parameters.booleanThe methodhasErrorsreturns the indicator whether the messages contain at least one error message.This method adds an info message with the given parameters.voidinfoMode()The methodinfoModeprovides means to switch to info mode.iterator()intsize()The methodsizeprovides means to get the number of messages.toHtml()The methodtoHtmlprovides means to format the messages as HTML.toString()toText()The methodtoTextprovides means to format the messages as text.This method adds a warning message with the given parameters.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Field Details
-
serialVersionUID
public static final long serialVersionUIDThe fieldserialVersionUIDcontains the version number.- See Also:
-
-
Constructor Details
-
Messages
public Messages()
-
-
Method Details
-
errorMessage
The methoderrorMessageprovides means to create a new Messages instance populated with an error.- Parameters:
msg- the error attributes- Returns:
- a new Messages
-
error
This method adds an error message with the given parameters.- Parameters:
msg- the parameters- Returns:
- this
-
errorOrWarning
This method adds an error message with the given parameters.- Parameters:
msg- the parameters- Returns:
- this
-
hasErrors
public boolean hasErrors()The methodhasErrorsreturns the indicator whether the messages contain at least one error message.- Returns:
- the indicator whether errors are contained
-
info
This method adds an info message with the given parameters.- Parameters:
msg- the parameters- Returns:
- this
-
infoMode
public void infoMode()The methodinfoModeprovides means to switch to info mode. -
iterator
-
size
public int size()The methodsizeprovides means to get the number of messages.- Returns:
- the number of messages
-
toHtml
The methodtoHtmlprovides means to format the messages as HTML.- Returns:
- the formatted messages
-
toString
-
toText
The methodtoTextprovides means to format the messages as text.- Returns:
- the formatted messages
-
warning
This method adds a warning message with the given parameters.- Parameters:
msg- the parameters- Returns:
- this
-