add lib-plugin interaction implementations on library side
[openflowjava.git] / openflow-protocol-impl / src / main / java / org / opendaylight / openflowjava / protocol / impl / connection / RpcResponseKey.java
1 /**
2  * Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.
3  *
4  * This program and the accompanying materials are made available under the
5  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6  * and is available at http://www.eclipse.org/legal/epl-v10.html
7  */
8
9 package org.opendaylight.openflowjava.protocol.impl.connection;
10
11
12 /**
13  * @author mirehak
14  *
15  */
16 public class RpcResponseKey {
17     
18     private final long xid;
19     private final String outputClazz;
20     /**
21      * @param xid
22      * @param outputClazz
23      */
24     public RpcResponseKey(long xid, String outputClazz) {
25         super();
26         this.xid = xid;
27         this.outputClazz = outputClazz;
28     }
29     
30     /**
31      * @return the xid
32      */
33     public long getXid() {
34         return xid;
35     }
36
37     /**
38      * @return the outputClazz
39      */
40     public String getOutputClazz() {
41         return outputClazz;
42     }
43
44     @Override
45     public int hashCode() {
46         final int prime = 31;
47         int result = 1;
48         result = prime * result
49                 + ((outputClazz == null) ? 0 : outputClazz.hashCode());
50         result = prime * result + (int) (xid ^ (xid >>> 32));
51         return result;
52     }
53
54     @Override
55     public boolean equals(Object obj) {
56         if (this == obj)
57             return true;
58         if (obj == null)
59             return false;
60         if (getClass() != obj.getClass())
61             return false;
62         RpcResponseKey other = (RpcResponseKey) obj;
63         if (outputClazz == null) {
64             if (other.outputClazz != null)
65                 return false;
66         } else if (!outputClazz.equals(other.outputClazz))
67             return false;
68         if (xid != other.xid)
69             return false;
70         return true;
71     }
72
73     @Override
74     public String toString() {
75         return "RpcResultKey [xid=" + xid + ", outputClazz=" + outputClazz
76                 + "]";
77     }
78
79 }