1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20 package org.apache.myfaces.push.cdi;
21
22 import java.io.Serializable;
23 import java.util.Objects;
24
25
26
27
28 public class WebsocketChannelMetadata implements Serializable
29 {
30 private String channel;
31
32 private String scope;
33
34 private Serializable user;
35
36 private boolean connected;
37
38 public WebsocketChannelMetadata(String channel, String scope, Serializable user, boolean connected)
39 {
40 this.channel = channel;
41 this.scope = scope;
42 this.user = user;
43 this.connected = connected;
44 }
45
46 public WebsocketChannelMetadata()
47 {
48 }
49
50
51
52
53 public String getChannel()
54 {
55 return channel;
56 }
57
58
59
60
61 public void setChannel(String channel)
62 {
63 this.channel = channel;
64 }
65
66
67
68
69 public String getScope()
70 {
71 return scope;
72 }
73
74
75
76
77 public void setScope(String scope)
78 {
79 this.scope = scope;
80 }
81
82
83
84
85 public Serializable getUser()
86 {
87 return user;
88 }
89
90
91
92
93 public void setUser(Serializable user)
94 {
95 this.user = user;
96 }
97
98
99
100
101 public boolean isConnected()
102 {
103 return connected;
104 }
105
106
107
108
109 public void setConnected(boolean connected)
110 {
111 this.connected = connected;
112 }
113
114 @Override
115 public int hashCode()
116 {
117 int hash = 5;
118 hash = 67 * hash + Objects.hashCode(this.channel);
119 hash = 67 * hash + Objects.hashCode(this.scope);
120 hash = 67 * hash + Objects.hashCode(this.user);
121 hash = 67 * hash + (this.connected ? 1 : 0);
122 return hash;
123 }
124
125 @Override
126 public boolean equals(Object obj)
127 {
128 if (obj == null)
129 {
130 return false;
131 }
132 if (getClass() != obj.getClass())
133 {
134 return false;
135 }
136 final WebsocketChannelMetadata other = (WebsocketChannelMetadata) obj;
137 if (!Objects.equals(this.channel, other.channel))
138 {
139 return false;
140 }
141 if (!Objects.equals(this.scope, other.scope))
142 {
143 return false;
144 }
145 if (!Objects.equals(this.user, other.user))
146 {
147 return false;
148 }
149 if (this.connected != other.connected)
150 {
151 return false;
152 }
153 return true;
154 }
155
156 }