Updated extension registration keys
[openflowjava.git] / openflow-protocol-api / src / main / java / org / opendaylight / openflowjava / protocol / api / extensibility / keys / InstructionDeserializerKey.java
1 /*\r
2  * Copyright (c) 2014 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 \r
9 package org.opendaylight.openflowjava.protocol.api.extensibility.keys;\r
10 \r
11 import org.opendaylight.openflowjava.protocol.api.extensibility.MessageCodeKey;\r
12 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.instruction.rev130731.instructions.grouping.Instruction;\r
13 \r
14 /**\r
15  * @author michal.polkorab\r
16  *\r
17  */\r
18 public class InstructionDeserializerKey extends MessageCodeKey {\r
19 \r
20     private Long experimenterId;\r
21     /**\r
22      * @param version protocol wire version\r
23      * @param type instruction type\r
24      * @param experimenterId \r
25      */\r
26     public InstructionDeserializerKey(short version, int type,\r
27             Long experimenterId) {\r
28         super(version, type, Instruction.class);\r
29         this.experimenterId = experimenterId;\r
30     }\r
31 \r
32     @Override\r
33     public boolean equals(Object obj) {\r
34         if (this == obj)\r
35             return true;\r
36         if (!super.equals(obj))\r
37             return false;\r
38         if (getClass() != obj.getClass())\r
39             return false;\r
40         InstructionDeserializerKey other = (InstructionDeserializerKey) obj;\r
41         if (experimenterId == null) {\r
42             if (other.experimenterId != null)\r
43                 return false;\r
44         } else if (!experimenterId.equals(other.experimenterId))\r
45             return false;\r
46         return true;\r
47     }\r
48 \r
49     @Override\r
50     public String toString() {\r
51         return super.toString() + " experimenterID: " + experimenterId;\r
52     }\r
53 }