-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathConnection.java
More file actions
88 lines (67 loc) · 1.68 KB
/
Connection.java
File metadata and controls
88 lines (67 loc) · 1.68 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
package wish;
import java.io.Serializable;
import java.util.Arrays;
/**
* Created by jeppe on 12/28/16.
*/
public class Connection implements Serializable{
private int cid;
private byte[] luid;
private byte[] ruid;
private byte[] rhid;
private boolean outgoing;
private boolean relay;
public int getCid() {
return cid;
}
public void setCid(int cid) {
this.cid = cid;
}
public byte[] getLuid() {
return luid;
}
public void setLuid(byte[] luid) {
this.luid = luid;
}
public byte[] getRuid() {
return ruid;
}
public void setRuid(byte[] ruid) {
this.ruid = ruid;
}
public byte[] getRhid() {
return rhid;
}
public void setRhid(byte[] rhid) {
this.rhid = rhid;
}
public boolean isOutgoing() {
return outgoing;
}
public boolean isRelayed() {
return relay;
}
public void setOutgoing(boolean outgoing) {
this.outgoing = outgoing;
}
public void setRelay(boolean relay) {
this.relay = relay;
}
public boolean equals(Object object) {
if (this == object) {
return true;
}
if (object == null) {
return false;
}
if (getClass() != object.getClass()) {
return false;
}
Connection connection = (Connection) object;
return Arrays.equals(luid, connection.getLuid())
&& Arrays.equals(ruid, connection.getRuid())
&& Arrays.equals(rhid, connection.getRhid())
&& cid == connection.getCid()
&& outgoing == connection.isOutgoing();
}
}