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
package mobvista.dmp.datasource.dsp.mapreduce;
public class SegmentVO implements Comparable<SegmentVO> {
private String id;
private String value;
public SegmentVO(String id, String value) {
this.id = id;
this.value = value;
}
@Override
public int compareTo(SegmentVO o) {
if (this.id.equals(o.getId())) {
return this.value.compareTo(o.getValue());
}
return this.id.compareTo(o.getId());
}
@Override
public boolean equals(Object obj) {
if (obj instanceof SegmentVO) {
SegmentVO segmentVO = (SegmentVO) obj;
return this.id.equals(segmentVO.getId());
}
return false;
}
@Override
public int hashCode() {
return this.id.hashCode();
}
@Override
public String toString() {
StringBuilder builder = new StringBuilder();
return builder.append("{ id=").append(this.id).append(", value=").append(this.value).append(" }").toString();
}
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getValue() {
return value;
}
public void setValue(String value) {
this.value = value;
}
}