1
|
1 package cl.maps.utils;
|
|
2
|
|
3 import org.apache.commons.lang.StringUtils;
|
|
4
|
|
5 public class RelKey {
|
|
6
|
|
7 private Long srcId;
|
|
8 private Long tarId;
|
|
9 private String relName;
|
|
10
|
|
11 public RelKey(Long srcId, Long tarId, String relName){
|
|
12 this.srcId = srcId;
|
|
13 this.tarId = tarId;
|
|
14 this.relName = relName;
|
|
15 }
|
|
16 public Long getSrcId() {
|
|
17 return srcId;
|
|
18 }
|
|
19 public void setSrcId(Long srcId) {
|
|
20 this.srcId = srcId;
|
|
21 }
|
|
22 public Long getTarId() {
|
|
23 return tarId;
|
|
24 }
|
|
25 public void setTarId(Long tarId) {
|
|
26 this.tarId = tarId;
|
|
27 }
|
|
28 public String getRelName() {
|
|
29 return relName;
|
|
30 }
|
|
31 public void setRelName(String relName) {
|
|
32 this.relName = relName;
|
|
33 }
|
|
34
|
|
35 @Override
|
|
36 public int hashCode() {
|
|
37 String s = this.srcId + "_" + this.tarId + "_" + relName;
|
|
38 return s.hashCode();
|
|
39 }
|
|
40
|
|
41 @Override
|
|
42 public boolean equals(Object o){
|
|
43 if(o instanceof RelKey){
|
|
44 RelKey other = (RelKey)o;
|
|
45 if(srcId.equals(other.srcId) &&
|
|
46 tarId.equals(other.tarId) &&
|
|
47 StringUtils.equals(relName, other.relName)){
|
|
48 return true;
|
|
49 }
|
|
50 }
|
|
51 return false;
|
|
52 }
|
|
53
|
|
54
|
|
55 }
|