View Javadoc
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       * Adds a message to the collection
14       *
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       *
23       * @param message the message
24       */
25      void addMessage(Message message);
26  
27      /**
28       * Adds all messages to the collection
29       *
30       * @param messages The list of messages
31       */
32      void addAll(List<Message> messages);
33  
34      /**
35       * @return True if the collection is empty
36       */
37      boolean isEmpty();
38  
39      /**
40       * @return the list of messages
41       */
42      List<Message> getMessages();
43  
44  }