View Javadoc

1   /**
2    * Atlassian Source Code Template.
3    * User: Bobby
4    * Date: Apr 8, 2003
5    * Time: 9:56:50 AM
6    * CVS Revision: $Revision: 1.2 $
7    * Last CVS Commit: $Date: 2003/12/13 06:09:33 $
8    * Author of last CVS Commit: $Author: mcannon $
9    */
10  
11  package com.atlassian.johnson.event;
12  
13  import com.atlassian.johnson.config.JohnsonConfig;
14  
15  public final class EventType
16  {
17      private String type;
18      private String description;
19  
20      public EventType(String type, String description)
21      {
22          this.type = type;
23          this.description = description;
24      }
25  
26      public String getType()
27      {
28          return type;
29      }
30  
31      public String getDescription()
32      {
33          return description;
34      }
35  
36      public static EventType get(String type)
37      {
38          return JohnsonConfig.getInstance().getEventType(type);
39      }
40  
41      public String toString()
42      {
43          return "(EventType: " + type + ")";
44      }
45  
46      public boolean equals(Object o)
47      {
48          if (this == o) return true;
49          if (!(o instanceof EventType)) return false;
50  
51          final EventType eventType = (EventType) o;
52  
53          if (description != null ? !description.equals(eventType.description) : eventType.description != null) return false;
54          if (!type.equals(eventType.type)) return false;
55  
56          return true;
57      }
58  
59      public int hashCode()
60      {
61          int result;
62          result = type.hashCode();
63          result = 29 * result + (description != null ? description.hashCode() : 0);
64          return result;
65      }
66  }