Umesh Krishnaswamy | 345ee99 | 2012-12-13 20:29:48 -0800 | [diff] [blame] | 1 | package net.floodlightcontroller.topology; |
| 2 | |
| 3 | public 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 | } |