1 package com.atlassian.sal.api.message;
2
3 import java.io.Serializable;
4 import java.util.List;
5
6 /**
7 * A collection of messages that haven't been resolved
8 *
9 * @since 2.0
10 */
11 public interface MessageCollection
12 {
13 /**
14 * Adds a message to the collection
15 * @param key The i18n key
16 * @param arguments The arguments to insert into the resolved message
17 */
18 void addMessage(String key, Serializable... arguments);
19
20 /**
21 * Adds a message to the collection
22 * @param message the message
23 */
24 void addMessage(Message message);
25
26 /**
27 * Adds all messages to the collection
28 *
29 * @param messages The list of messages
30 */
31 void addAll(List<Message> messages);
32
33 /**
34 * @return True if the collection is empty
35 */
36 boolean isEmpty();
37
38 /**
39 * @return the list of messages
40 */
41 List<Message> getMessages();
42
43 }