示例#1
0
 public Message updateMessage(Message message) {
   if (message.getId() < 0) {
     return null;
   }
   messages.put(message.getId(), message);
   return message;
 }
示例#2
0
 public Message removeMessage(Message message) {
   return messages.remove(message.getId());
 }
示例#3
0
 public Message addMessage(Message message) {
   message.setId(messages.size() + 1);
   messages.put(message.getId(), message);
   return message;
 }