View Javadoc

1   package com.atlassian.johnson.event;
2   
3   import com.atlassian.johnson.config.JohnsonConfig;
4   
5   public final class EventType
6   {
7       private String type;
8       private String description;
9   
10      public EventType(String type, String description)
11      {
12          this.type = type;
13          this.description = description;
14      }
15  
16      public String getType()
17      {
18          return type;
19      }
20  
21      public String getDescription()
22      {
23          return description;
24      }
25  
26      public static EventType get(String type)
27      {
28          return JohnsonConfig.getInstance().getEventType(type);
29      }
30  
31      public String toString()
32      {
33          return "(EventType: " + type + ")";
34      }
35  
36      public boolean equals(Object o)
37      {
38          if (this == o) return true;
39          if (!(o instanceof EventType)) return false;
40  
41          final EventType eventType = (EventType) o;
42  
43          if (description != null ? !description.equals(eventType.description) : eventType.description != null) return false;
44          if (!type.equals(eventType.type)) return false;
45  
46          return true;
47      }
48  
49      public int hashCode()
50      {
51          int result;
52          result = type.hashCode();
53          result = 29 * result + (description != null ? description.hashCode() : 0);
54          return result;
55      }
56  }