updated message dispatcher to send the multipart request message to library
[openflowplugin.git] / openflowplugin / src / main / java / org / opendaylight / openflowplugin / openflow / md / core / TranslatorKey.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 package org.opendaylight.openflowplugin.openflow.md.core;
9
10 /**
11  * @author mirehak
12  */
13 public class TranslatorKey {
14     
15     private int version;
16     private String messageClass;
17     
18     /**
19      * @param version
20      * @param messageClass
21      */
22     public TranslatorKey(int version, String messageClass) {
23         this.version = version;
24         this.messageClass = messageClass;
25     }
26     
27     @Override
28     public int hashCode() {
29         final int prime = 31;
30         int result = 1;
31         result = prime * result
32                 + ((messageClass == null) ? 0 : messageClass.hashCode());
33         result = prime * result + version;
34         return result;
35     }
36
37     @Override
38     public boolean equals(Object obj) {
39         if (this == obj)
40             return true;
41         if (obj == null)
42             return false;
43         if (getClass() != obj.getClass())
44             return false;
45         TranslatorKey other = (TranslatorKey) obj;
46         if (messageClass == null) {
47             if (other.messageClass != null)
48                 return false;
49         } else if (!messageClass.equals(other.messageClass))
50             return false;
51         if (version != other.version)
52             return false;
53         return true;
54     }
55
56 }