public class MessageBag extends Object implements Serializable
All operations done on objects of this class are synchronized.
Note that after any cleanup types keys are left in the container, just with empty messages lists.
| Modifier and Type | Class and Description |
|---|---|
static class |
MessageBag.Message
Internal message abstraction.
|
| Constructor and Description |
|---|
MessageBag() |
| Modifier and Type | Method and Description |
|---|---|
void |
addMessage(String type,
String message)
Adds message to container.
|
Map<String,List<MessageBag.Message>> |
getAllMessages()
Returns all messages and clears the container.
|
List<MessageBag.Message> |
getMessages(String type)
Returns all messages of given type and clears container for that type.
|
boolean |
hasMessages()
Checks if container has any messages.
|
boolean |
hasMessages(String type)
Checks if container has messages of given type.
|
public void addMessage(String type, String message)
type - Message type.message - Message content.public boolean hasMessages()
public boolean hasMessages(String type)
type - Messages type.public List<MessageBag.Message> getMessages(String type)
type - Messages type.public Map<String,List<MessageBag.Message>> getAllMessages()
Copyright © 2014–2015 RafaĆ Wrzeszcz - Wrzasq.pl. All rights reserved.