blob: 767ce94c0479382bf5db9e7ba5880cc8db889fd3 [file] [log] [blame]
Umesh Krishnaswamy345ee992012-12-13 20:29:48 -08001package net.floodlightcontroller.flowcache;
2
3public class PendingSwRespKey {
4 long swDpid;
5 int transId;
6
7 public PendingSwRespKey(long swDpid, int transId) {
8 this.swDpid = swDpid;
9 this.transId = transId;
10 }
11
12 @Override
13 public int hashCode() {
14 final int prime = 97;
15 Long dpid = swDpid;
16 Integer tid = transId;
17 return (tid.hashCode()*prime + dpid.hashCode());
18 }
19
20 @Override
21 public boolean equals(Object obj) {
22 if (this == obj) {
23 return true;
24 }
25 if (obj == null) {
26 return false;
27 }
28 if (!(obj instanceof PendingSwRespKey)) {
29 return false;
30 }
31 PendingSwRespKey other = (PendingSwRespKey) obj;
32 if ((swDpid != other.swDpid) || (transId != other.transId)) {
33 return false;
34 }
35 return true;
36 }
37
38 @Override
39 public String toString() {
40 return Long.toHexString(swDpid)+","+Integer.toString(transId);
41 }
42}