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.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.ActionChoice;
12 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.actions.grouping.Action;
15 * @author michal.polkorab
16 * @param <T> action type
18 public class ActionSerializerKey<T extends ActionChoice> extends MessageTypeKey<Action> {
20 private Class<T> actionType;
21 private Long experimenterId;
24 * @param msgVersion protocol wire version
25 * @param actionType type of action
26 * @param experimenterId experimenter / vendor ID
28 public ActionSerializerKey(short msgVersion, Class<T> actionType,
29 Long experimenterId) {
30 super(msgVersion, Action.class);
31 this.actionType = actionType;
32 this.experimenterId = experimenterId;
36 public int hashCode() {
38 int result = super.hashCode();
39 result = prime * result + ((actionType == null) ? 0 : actionType.hashCode());
40 result = prime * result + ((experimenterId == null) ? 0 : experimenterId.hashCode());
45 public boolean equals(Object obj) {
49 if (!super.equals(obj)) {
52 if (getClass() != obj.getClass()) {
55 ActionSerializerKey<?> other = (ActionSerializerKey<?>) obj;
56 if (actionType == null) {
57 if (other.actionType != null) {
60 } else if (!actionType.equals(other.actionType)) {
63 if (experimenterId == null) {
64 if (other.experimenterId != null) {
67 } else if (!experimenterId.equals(other.experimenterId)) {
74 public String toString() {
75 return super.toString() + " action type: " + actionType.getName() + " experimenterID: " + experimenterId;