2 * Copyright (c) 2014 Pantheon Technologies s.r.o. and others. All rights reserved.
\r
4 * This program and the accompanying materials are made available under the
\r
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
\r
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
\r
9 package org.opendaylight.openflowjava.protocol.api.keys;
\r
11 import org.opendaylight.openflowjava.protocol.api.extensibility.MessageTypeKey;
\r
12 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.actions.grouping.Action;
\r
13 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.ActionBase;
\r
16 * @author michal.polkorab
\r
17 * @param <TYPE> action type
\r
19 public class ActionSerializerKey<TYPE extends ActionBase> extends MessageTypeKey<Action> {
\r
21 private Class<TYPE> actionType;
\r
22 private Long experimenterId;
\r
25 * @param msgVersion protocol wire version
\r
26 * @param actionType type of action
\r
27 * @param experimenterId experimenter / vendor ID
\r
29 public ActionSerializerKey(short msgVersion, Class<TYPE> actionType,
\r
30 Long experimenterId) {
\r
31 super(msgVersion, Action.class);
\r
32 this.actionType = actionType;
\r
33 this.experimenterId = experimenterId;
\r
37 public int hashCode() {
\r
38 final int prime = 31;
\r
39 int result = super.hashCode();
\r
40 result = prime * result + ((actionType == null) ? 0 : actionType.hashCode());
\r
41 result = prime * result + ((experimenterId == null) ? 0 : experimenterId.hashCode());
\r
46 public boolean equals(Object obj) {
\r
50 if (!super.equals(obj)) {
\r
53 if (getClass() != obj.getClass()) {
\r
56 ActionSerializerKey<?> other = (ActionSerializerKey<?>) obj;
\r
57 if (actionType == null) {
\r
58 if (other.actionType != null) {
\r
61 } else if (!actionType.equals(other.actionType)) {
\r
64 if (experimenterId == null) {
\r
65 if (other.experimenterId != null) {
\r
68 } else if (!experimenterId.equals(other.experimenterId)) {
\r
75 public String toString() {
\r
76 return super.toString() + " action type: " + actionType.getName() + " experimenterID: " + experimenterId;
\r