Mass replace CRLF->LF
[openflowjava.git] / openflow-protocol-impl / src / main / java / org / opendaylight / openflowjava / protocol / impl / util / TypeToClassKey.java
1 /*
2  * Copyright (c) 2013 Pantheon Technologies s.r.o. 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.openflowjava.protocol.impl.util;
9
10 /**
11  * @author michal.polkorab
12  *
13  */
14 public class TypeToClassKey {
15
16     private short version;
17     private int type;
18
19     /**
20      * Constructor
21      * @param version wire protocol version
22      * @param type message type / code
23      */
24     public TypeToClassKey(short version, int type) {
25         this.version = version;
26         this.type = type;
27     }
28
29     @Override
30     public int hashCode() {
31         final int prime = 31;
32         int result = 1;
33         result = prime * result + type;
34         return result;
35     }
36
37     @Override
38     public boolean equals(Object obj) {
39         if (this == obj) {
40             return true;
41         }
42         if (obj == null) {
43             return false;
44         }
45         if (getClass() != obj.getClass()) {
46             return false;
47         }
48         TypeToClassKey other = (TypeToClassKey) obj;
49         if (type != other.type) {
50             return false;
51         }
52         if (version != other.version) {
53             return false;
54         }
55         return true;
56     }
57 }