Javadoc update
[openflowjava.git] / openflow-protocol-impl / src / main / java / org / opendaylight / openflowjava / protocol / impl / connection / RpcResponseKey.java
1 /* Copyright (C)2013 Pantheon Technologies, s.r.o. All rights reserved. */
2
3 package org.opendaylight.openflowjava.protocol.impl.connection;
4
5 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.OfHeader;
6
7
8 /**
9  * @author mirehak
10  */
11 public class RpcResponseKey {
12     
13     private final long xid;
14     private final Class<? extends OfHeader> outputClazz;
15     /**
16      * @param xid
17      * @param outputClazz
18      */
19     public RpcResponseKey(long xid, Class<? extends OfHeader> outputClazz) {
20         super();
21         this.xid = xid;
22         this.outputClazz = outputClazz;
23     }
24     
25     /**
26      * @return the xid
27      */
28     public long getXid() {
29         return xid;
30     }
31
32     /**
33      * @return the outputClazz
34      */
35     public Class<? extends OfHeader> getOutputClazz() {
36         return outputClazz;
37     }
38     
39     @Override
40     public int hashCode() {
41         final int prime = 31;
42         int result = 1;
43         result = prime * result + (int) (xid ^ (xid >>> 32));
44         return result;
45     }
46
47     @Override
48     public boolean equals(Object obj) {
49         if (this == obj)
50             return true;
51         if (obj == null)
52             return false;
53         if (getClass() != obj.getClass())
54             return false;
55         RpcResponseKey other = (RpcResponseKey) obj;
56         if (outputClazz == null) {
57             if (other.outputClazz != null)
58                 return false;
59             } else if (!other.outputClazz.isAssignableFrom(outputClazz))
60                 return false;
61         if (xid != other.xid)
62             return false;
63         return true;
64     }
65
66     @Override
67     public String toString() {
68         return "RpcResultKey [xid=" + xid + ", outputClazz=" + outputClazz
69                 + "]";
70     }
71
72 }