blob: af9e677c45d59222c351e7d1533be7ddda19b002 [file] [log] [blame]
Umesh Krishnaswamy345ee992012-12-13 20:29:48 -08001package net.floodlightcontroller.topology;
2
3public class OrderedNodePair {
4 private long src;
5 private long dst;
6
7 public OrderedNodePair(long s, long d) {
8 src = s;
9 dst = d;
10 }
11
12 public long getSrc() {
13 return src;
14 }
15
16 public long getDst() {
17 return dst;
18 }
19
20 @Override
21 public int hashCode() {
22 final int prime = 2417;
23 int result = 1;
24 result = prime * result + (int) (dst ^ (dst >>> 32));
25 result = prime * result + (int) (src ^ (src >>> 32));
26 return result;
27 }
28
29 @Override
30 public boolean equals(Object obj) {
31 if (this == obj)
32 return true;
33 if (obj == null)
34 return false;
35 if (getClass() != obj.getClass())
36 return false;
37 OrderedNodePair other = (OrderedNodePair) obj;
38 if (dst != other.dst)
39 return false;
40 if (src != other.src)
41 return false;
42 return true;
43 }
44
45 @Override
46 public String toString() {
47 return "OrderedNodePair [src=" + src + ", dst=" + dst + "]";
48 }
49}