Mass replace CRLF->LF
[openflowjava.git] / openflow-protocol-api / src / main / java / org / opendaylight / openflowjava / protocol / api / keys / ActionDeserializerKey.java
1 /*
2  * Copyright (c) 2014 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
9 package org.opendaylight.openflowjava.protocol.api.keys;
10
11 import org.opendaylight.openflowjava.protocol.api.extensibility.MessageCodeKey;
12 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.actions.grouping.Action;
13
14 /**
15  * @author michal.polkorab
16  *
17  */
18 public class ActionDeserializerKey extends MessageCodeKey {
19
20     private Long experimenterId;
21     /**
22      * @param version protocol wire version
23      * @param type action type
24      * @param experimenterId experimenter / vendor ID
25      */
26     public ActionDeserializerKey(short version,
27             int type, Long experimenterId) {
28         super(version, type, Action.class);
29         this.experimenterId = experimenterId;
30     }
31
32     @Override
33     public int hashCode() {
34         final int prime = 31;
35         int result = super.hashCode();
36         result = prime * result + ((experimenterId == null) ? 0 : experimenterId.hashCode());
37         return result;
38     }
39
40     @Override
41     public boolean equals(Object obj) {
42         if (this == obj) {
43             return true;
44         }
45         if (!super.equals(obj)) {
46             return false;
47         }
48         if (!(obj instanceof ActionDeserializerKey)) {
49             return false;
50         }
51         ActionDeserializerKey other = (ActionDeserializerKey) obj;
52         if (experimenterId == null) {
53             if (other.experimenterId != null) {
54                 return false;
55             }
56         } else if (!experimenterId.equals(other.experimenterId)) {
57             return false;
58         }
59         return true;
60     }
61
62     @Override
63     public String toString() {
64         return super.toString() + " experimenterID: " + experimenterId;
65     }
66 }