Copyright update
[openflowjava.git] / openflow-protocol-impl / src / main / java / org / opendaylight / openflowjava / protocol / impl / connection / RpcResponseKey.java
index 7bd4f3605a163e3ea9855a79fcc0ffc112001f8f..a01098d4ccbcdb80b95871e442c9b2d05984702a 100644 (file)
@@ -1,8 +1,14 @@
-/* Copyright (C)2013 Pantheon Technologies, s.r.o. All rights reserved. */
+/*
+ * Copyright (c) 2013 Pantheon Technologies s.r.o. and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+
 
 package org.opendaylight.openflowjava.protocol.impl.connection;
 
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.OfHeader;
 
 
 /**
@@ -11,13 +17,12 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731
 public class RpcResponseKey {
     
     private final long xid;
-    private final Class<? extends OfHeader> outputClazz;
+    private final String outputClazz;
     /**
      * @param xid
      * @param outputClazz
      */
-    public RpcResponseKey(long xid, Class<? extends OfHeader> outputClazz) {
-        super();
+    public RpcResponseKey(long xid, String outputClazz) {
         this.xid = xid;
         this.outputClazz = outputClazz;
     }
@@ -32,7 +37,7 @@ public class RpcResponseKey {
     /**
      * @return the outputClazz
      */
-    public Class<? extends OfHeader> getOutputClazz() {
+    public String getOutputClazz() {
         return outputClazz;
     }
     
@@ -40,7 +45,8 @@ public class RpcResponseKey {
     public int hashCode() {
         final int prime = 31;
         int result = 1;
-        result = prime * result + (int) (xid ^ (xid >>> 32));
+        result = prime * result
+                + ((outputClazz == null) ? 0 : outputClazz.hashCode());
         return result;
     }
 
@@ -56,10 +62,10 @@ public class RpcResponseKey {
         if (outputClazz == null) {
             if (other.outputClazz != null)
                 return false;
-            } else if (!other.outputClazz.isAssignableFrom(outputClazz))
-                return false;
-        if (xid != other.xid)
+        } else if (!outputClazz.equals(other.outputClazz))
             return false;
+//        if (xid != other.xid)
+//            return false;
         return true;
     }