1
2
3
4
5
6
7
8
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 }