OSDN Git Service

Delete Subversion Tags (Revision, Id)
[stigmata/stigmata.git] / src / main / java / jp / sourceforge / stigmata / event / WarningMessages.java
1 package jp.sourceforge.stigmata.event;
2
3 import java.util.HashMap;
4 import java.util.Iterator;
5 import java.util.Map;
6
7 /**
8  * 
9  * @author Haruaki Tamada
10  */
11 public class WarningMessages{
12     private OperationType type;
13     private Map<Exception, String> messages = new HashMap<Exception, String>();
14
15     public WarningMessages(OperationType type){
16         this.type = type;
17     }
18
19     public void addMessage(Exception e, String string){
20         messages.put(e, string);
21     }
22
23     public Iterator<Exception> exceptions(){
24         return messages.keySet().iterator();
25     }
26
27     public String getString(Exception e){
28         return messages.get(e);
29     }
30
31     public OperationType getType(){
32         return type;
33     }
34
35     public void setType(OperationType type){
36         this.type = type;
37     }
38
39     public int getWarningCount(){
40         return messages.size();
41     }
42 }