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.extensibility.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 boolean equals(Object obj) {
\r
40 if (!super.equals(obj))
\r
42 if (getClass() != obj.getClass())
\r
44 @SuppressWarnings("rawtypes")
\r
45 ActionSerializerKey other = (ActionSerializerKey) obj;
\r
46 if (actionType == null) {
\r
47 if (other.actionType != null)
\r
49 } else if (!actionType.equals(other.actionType))
\r
51 if (experimenterId == null) {
\r
52 if (other.experimenterId != null)
\r
54 } else if (!experimenterId.equals(other.experimenterId))
\r
60 public String toString() {
\r
61 return super.toString() + " action type: " + actionType.getName() + " experimenterID: " + experimenterId;
\r