BUG-1006 - removal of bulkTransactionCache
[openflowplugin.git] / openflowplugin / src / main / java / org / opendaylight / openflowplugin / openflow / md / core / session / TransactionKey.java
1 package org.opendaylight.openflowplugin.openflow.md.core.session;
2
3 public class TransactionKey {
4
5     private static final long serialVersionUID = 7805731164917659700L;
6     final private Long _xId;
7
8     public TransactionKey(Long transactionId) {
9         this._xId = transactionId;
10     }
11
12     public Long getXId() {
13         return _xId;
14     }
15
16
17     @Override
18     public int hashCode() {
19         final int prime = 31;
20         int result = 1;
21         result = prime * result + ((_xId == null) ? 0 : _xId.hashCode());
22         return result;
23     }
24
25     @Override
26     public boolean equals(java.lang.Object obj) {
27         if (this == obj) {
28             return true;
29         }
30         if (obj == null) {
31             return false;
32         }
33         if (getClass() != obj.getClass()) {
34             return false;
35         }
36         TransactionKey other = (TransactionKey) obj;
37         if (_xId == null) {
38             if (other._xId != null) {
39                 return false;
40             }
41         } else if (!_xId.equals(other._xId)) {
42             return false;
43         }
44         return true;
45     }
46
47     @Override
48     public String toString() {
49         StringBuilder builder = new StringBuilder();
50         builder.append("TransactionId [_xId=");
51         builder.append(_xId);
52         builder.append("]");
53         return builder.toString();
54     }
55
56 }