T
- the type of messages in this containerpublic interface MultipleMessagesContainer<T extends Message> extends SingleMessageContainer<T>
MessageContainer
that can contain multiple messages.MessageContainer
,
SelectableMessagesContainer
,
SingleMessageContainer
Modifier and Type | Method and Description |
---|---|
T |
getMessage()
Returns the contained message.
|
List<T> |
getMessages()
Returns all the contained messages or an empty
List if none. |
int |
getNumberOfMessages()
Returns the number of contained messages.
|
getComponent, getMessageClass, getName, isEmpty
T getMessage()
null
if no message is present or an error
occurred while getting the message (for example, failed to read a persisted message).
If multiple messages are present the first one is returned.
getMessage
in interface SingleMessageContainer<T extends Message>
null
if not present or an error occurred while
getting the message.int getNumberOfMessages()
List<T> getMessages()
List
if none.
No assumptions should be made on the actual implementation type of the List
returned by this method (for example, it might be unmodifiable or its elements lazy loaded).
Note: Extra care should be taken when getting the messages from the list
since it might return null
which indicates that an error occurred while getting a
message (for example, failed to read a persisted message).
List
with all the contained messages, never null
.