public interface Messages
Message
s with different severity within the RequestContext
.
Message
s provide additional information which may be added to the request's response.RequestContext.getMessages()
Modifier and Type | Method and Description |
---|---|
Message |
error(String messageOrKey,
Object... params)
Adds a new
Message with severity Message.Severity.ERROR to the current request with the given message text or format and format parameters. |
Message |
info(String messageOrKey,
Object... params)
Adds a new
Message with severity Message.Severity.INFO to the current request with the given message text or format and format parameters. |
Stream<Message> |
stream()
Returns a
Stream of the added messages in the current request context |
Message |
success(String messageOrKey,
Object... params)
Adds a new
Message with severity Message.Severity.SUCCESS to the current request with the given message text or format and format parameters. |
void |
throwIfError()
Throws a service exception, if error messages have been added to the current request.
|
Message |
warn(String messageOrKey,
Object... params)
Adds a new
Message with severity Message.Severity.WARNING to the current request with the given message text or format and format parameters. |
Message info(String messageOrKey, Object... params)
Message
with severity Message.Severity.INFO
to the current request with the given message text or format and format parameters.
In case a key to a message format is passed, the request's locale is taken for localization.messageOrKey
- The message format or a key to a message format in the resource bundles.params
- The parameters to fill the message format.Message
object which can be adapted accordinglyMessage success(String messageOrKey, Object... params)
Message
with severity Message.Severity.SUCCESS
to the current request with the given message text or format and format parameters.
In case a key to a message format is passed, the request's locale is taken for localization.messageOrKey
- The message format or a key to a message format in the resource bundles.params
- The parameters to fill the message format.Message
object which can be adapted accordinglyMessage warn(String messageOrKey, Object... params)
Message
with severity Message.Severity.WARNING
to the current request with the given message text or format and format parameters.
In case a key to a message format is passed, the request's locale is taken for localization.messageOrKey
- The message format or a key to a message format in the resource bundles.params
- The parameters to fill the message format.Message
object which can be adapted accordinglyMessage error(String messageOrKey, Object... params)
Message
with severity Message.Severity.ERROR
to the current request with the given message text or format and format parameters.
In case a key to a message format is passed, the request's locale is taken for localization.messageOrKey
- The message format or a key to a message format in the resource bundles.params
- The parameters to fill the message format.Message
object which can be adapted accordinglyStream<Message> stream()
Stream
of the added messages in the current request contextStream
of the added messagesvoid throwIfError() throws ServiceException
ServiceException
- if there was at least one error message added to the current requestCopyright © 2023. All rights reserved.