Extensibility support (deserialization part)
[openflowjava.git] / openflow-protocol-api / src / main / java / org / opendaylight / openflowjava / protocol / api / extensibility / EnhancedMessageCodeKey.java
1 /*\r
2  * Copyright (c) 2013 Pantheon Technologies s.r.o. and others.  All rights reserved.\r
3  *\r
4  * This program and the accompanying materials are made available under the\r
5  * terms of the Eclipse Public License v1.0 which accompanies this distribution,\r
6  * and is available at http://www.eclipse.org/legal/epl-v10.html\r
7  */\r
8 package org.opendaylight.openflowjava.protocol.api.extensibility;\r
9 \r
10 /**\r
11  * @author michal.polkorab\r
12  *\r
13  */\r
14 public class EnhancedMessageCodeKey extends MessageCodeKey {\r
15 \r
16     private int msgType2;\r
17 \r
18     /**\r
19      * Constructor\r
20      * @param version wire protocol version\r
21      * @param value used as distinguisher\r
22      * @param value2 used as detailed distinguisher\r
23      * @param clazz class of object that is going to be deserialized\r
24      */\r
25     public EnhancedMessageCodeKey(short version, int value, int value2, Class<?> clazz) {\r
26         super(version, value, clazz);\r
27         this.msgType2 = value2;\r
28     }\r
29 \r
30     @Override\r
31     public boolean equals(Object obj) {\r
32         if (this == obj)\r
33             return true;\r
34         if (!super.equals(obj))\r
35             return false;\r
36         if (getClass() != obj.getClass())\r
37             return false;\r
38         EnhancedMessageCodeKey other = (EnhancedMessageCodeKey) obj;\r
39         if (msgType2 != other.msgType2)\r
40             return false;\r
41         return true;\r
42     }\r
43 \r
44     @Override\r
45     public String toString() {\r
46         return super.toString() + " msgType2: " + msgType2;\r
47     }\r
48 }\r