JobClientNode.java
1.79 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
package com.github.ltsopensource.jobtracker.domain;
import com.github.ltsopensource.jobtracker.channel.ChannelWrapper;
/**
* @author Robert HG (254963746@qq.com) on 8/17/14.
* 客户端节点
*/
public class JobClientNode {
// 节点组名称
public String nodeGroup;
// 唯一标识
public String identity;
// 该节点的channel
public ChannelWrapper channel;
public JobClientNode(String nodeGroup, String identity, ChannelWrapper channel) {
this.nodeGroup = nodeGroup;
this.identity = identity;
this.channel = channel;
}
public JobClientNode(String identity) {
this.identity = identity;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (!(o instanceof JobClientNode)) return false;
JobClientNode that = (JobClientNode) o;
if (identity != null ? !identity.equals(that.identity) : that.identity != null) return false;
return true;
}
@Override
public int hashCode() {
return identity != null ? identity.hashCode() : 0;
}
public String getNodeGroup() {
return nodeGroup;
}
public void setNodeGroup(String nodeGroup) {
this.nodeGroup = nodeGroup;
}
public String getIdentity() {
return identity;
}
public void setIdentity(String identity) {
this.identity = identity;
}
public ChannelWrapper getChannel() {
return channel;
}
public void setChannel(ChannelWrapper channel) {
this.channel = channel;
}
@Override
public String toString() {
return "JobClientNode{" +
"nodeGroup='" + nodeGroup + '\'' +
", identity='" + identity + '\'' +
", channel=" + channel +
'}';
}
}