2 * Copyright (c) 2014 Pantheon Technologies s.r.o. and others. All rights reserved.
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
9 package org.opendaylight.openflowjava.protocol.api.keys;
11 import org.opendaylight.openflowjava.protocol.api.extensibility.MessageTypeKey;
12 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.actions.grouping.Action;
13 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.ActionBase;
16 * @author michal.polkorab
17 * @param <TYPE> action type
19 public class ActionSerializerKey<TYPE extends ActionBase> extends MessageTypeKey<Action> {
21 private Class<TYPE> actionType;
22 private Long experimenterId;
25 * @param msgVersion protocol wire version
26 * @param actionType type of action
27 * @param experimenterId experimenter / vendor ID
29 public ActionSerializerKey(short msgVersion, Class<TYPE> actionType,
30 Long experimenterId) {
31 super(msgVersion, Action.class);
32 this.actionType = actionType;
33 this.experimenterId = experimenterId;
37 public int hashCode() {
39 int result = super.hashCode();
40 result = prime * result + ((actionType == null) ? 0 : actionType.hashCode());
41 result = prime * result + ((experimenterId == null) ? 0 : experimenterId.hashCode());
46 public boolean equals(Object obj) {
50 if (!super.equals(obj)) {
53 if (getClass() != obj.getClass()) {
56 ActionSerializerKey<?> other = (ActionSerializerKey<?>) obj;
57 if (actionType == null) {
58 if (other.actionType != null) {
61 } else if (!actionType.equals(other.actionType)) {
64 if (experimenterId == null) {
65 if (other.experimenterId != null) {
68 } else if (!experimenterId.equals(other.experimenterId)) {
75 public String toString() {
76 return super.toString() + " action type: " + actionType.getName() + " experimenterID: " + experimenterId;