1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 package org.eclipse.jetty.websocket.core.driver;
20
21
22
23
24
25
26 public class EventMethods
27 {
28 private Class<?> pojoClass;
29 private boolean isAnnotated = false;
30 public EventMethod onConnect = null;
31 public EventMethod onClose = null;
32 public EventMethod onBinary = null;
33 public EventMethod onBinaryStream = null;
34 public EventMethod onText = null;
35 public EventMethod onTextStream = null;
36 public EventMethod onException = null;
37 public EventMethod onFrame = null;
38
39 public EventMethods(Class<?> pojoClass, boolean annotated)
40 {
41 this.pojoClass = pojoClass;
42 this.isAnnotated = annotated;
43 }
44
45 @Override
46 public boolean equals(Object obj)
47 {
48 if (this == obj)
49 {
50 return true;
51 }
52 if (obj == null)
53 {
54 return false;
55 }
56 if (getClass() != obj.getClass())
57 {
58 return false;
59 }
60 EventMethods other = (EventMethods)obj;
61 if (pojoClass == null)
62 {
63 if (other.pojoClass != null)
64 {
65 return false;
66 }
67 }
68 else if (!pojoClass.getName().equals(other.pojoClass.getName()))
69 {
70 return false;
71 }
72 return true;
73 }
74
75 public Class<?> getPojoClass()
76 {
77 return pojoClass;
78 }
79
80 @Override
81 public int hashCode()
82 {
83 final int prime = 31;
84 int result = 1;
85 result = (prime * result) + ((pojoClass == null)?0:pojoClass.getName().hashCode());
86 return result;
87 }
88
89 public boolean isAnnotated()
90 {
91 return isAnnotated;
92 }
93
94 @Override
95 public String toString()
96 {
97 StringBuilder builder = new StringBuilder();
98 builder.append("EventMethods [pojoClass=");
99 builder.append(pojoClass);
100 builder.append(", isAnnotated=");
101 builder.append(isAnnotated);
102 builder.append(", onConnect=");
103 builder.append(onConnect);
104 builder.append(", onClose=");
105 builder.append(onClose);
106 builder.append(", onBinary=");
107 builder.append(onBinary);
108 builder.append(", onText=");
109 builder.append(onText);
110 builder.append(", onException=");
111 builder.append(onException);
112 builder.append(", onFrame=");
113 builder.append(onFrame);
114 builder.append("]");
115 return builder.toString();
116 }
117
118 }