Copyright update
[openflowjava.git] / openflow-protocol-impl / src / main / java / org / opendaylight / openflowjava / protocol / impl / serialization / MessageTypeKey.java
index 56a1661bb5537f43a89a2fd5f72a965136d86650..38cdcda9ecd4d6e527acf780c9f1f768c84cc300 100644 (file)
@@ -1,73 +1,80 @@
-/* Copyright (C)2013 Pantheon Technologies, s.r.o. All rights reserved. */\r
-package org.opendaylight.openflowjava.protocol.impl.serialization;\r
-\r
-import org.opendaylight.yangtools.yang.binding.DataObject;\r
-\r
-/**\r
- * Class used as a key in {@link EncoderTable}\r
- * @author michal.polkorab\r
- * @author timotej.kubas\r
- * @param <E> message type (class)\r
- */\r
-public class MessageTypeKey<E extends DataObject> {\r
-\r
-    private final Class<E> msgType;\r
-    private final short msgVersion;\r
-    \r
-    /**\r
-     * @param msgVersion protocol version\r
-     * @param msgType type of message\r
-     */\r
-    public MessageTypeKey(short msgVersion, Class<E> msgType) {\r
-        super();\r
-        this.msgType = msgType;\r
-        this.msgVersion = msgVersion;\r
-    }\r
-    \r
-    /**\r
-     * @return msgVersion\r
-     */\r
-    public short getMsgVersion() {\r
-        return msgVersion;\r
-    }\r
-\r
-    /**\r
-     * @return the msgType\r
-     */\r
-    public Class<E> getMsgType() {\r
-        return msgType;\r
-    }\r
-\r
-    @Override\r
-    public String toString() {\r
-        return "msgVersion: " + msgVersion + " msgType: " + msgType.getName();\r
-    }\r
-\r
-    @Override\r
-    public int hashCode() {\r
-        final int prime = 31;\r
-        int result = 1;\r
-        result = prime * result + msgVersion;\r
-        return result;\r
-    }\r
-\r
-    @Override\r
-    public boolean equals(Object obj) {\r
-        if (this == obj)\r
-            return true;\r
-        if (obj == null)\r
-            return false;\r
-        if (getClass() != obj.getClass())\r
-            return false;\r
-        MessageTypeKey<?> other = (MessageTypeKey<?>) obj;\r
-        if (msgType == null) {\r
-            if (other.msgType != null)\r
-                return false;\r
-        } else if (!other.msgType.isAssignableFrom(msgType))\r
-            return false;\r
-        if (msgVersion != other.msgVersion)\r
-            return false;\r
-        return true;\r
-    }\r
\r
-}\r
+/*
+ * 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.serialization;
+
+import org.opendaylight.yangtools.yang.binding.DataObject;
+
+/**
+ * Class used as a key in {@link EncoderTable}
+ * @author michal.polkorab
+ * @author timotej.kubas
+ * @param <E> message type (class)
+ */
+public class MessageTypeKey<E extends DataObject> {
+
+    private final Class<E> msgType;
+    private final short msgVersion;
+    
+    /**
+     * @param msgVersion protocol version
+     * @param msgType type of message
+     */
+    public MessageTypeKey(short msgVersion, Class<E> msgType) {
+        super();
+        this.msgType = msgType;
+        this.msgVersion = msgVersion;
+    }
+    
+    /**
+     * @return msgVersion
+     */
+    public short getMsgVersion() {
+        return msgVersion;
+    }
+
+    /**
+     * @return the msgType
+     */
+    public Class<E> getMsgType() {
+        return msgType;
+    }
+
+    @Override
+    public String toString() {
+        return "msgVersion: " + msgVersion + " msgType: " + msgType.getName();
+    }
+
+    @Override
+    public int hashCode() {
+        final int prime = 31;
+        int result = 1;
+        result = prime * result + msgVersion;
+        return result;
+    }
+
+    @Override
+    public boolean equals(Object obj) {
+        if (this == obj)
+            return true;
+        if (obj == null)
+            return false;
+        if (getClass() != obj.getClass())
+            return false;
+        MessageTypeKey<?> other = (MessageTypeKey<?>) obj;
+        if (msgType == null) {
+            if (other.msgType != null)
+                return false;
+        } else if (!other.msgType.isAssignableFrom(msgType))
+            return false;
+        if (msgVersion != other.msgVersion)
+            return false;
+        return true;
+    }
+}