2 * Copyright (c) 2014 Cisco Systems, Inc. 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
8 package org.opendaylight.openflowjava.nx.api;
10 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.ActionChoice;
13 * Serializer key for a Nicira action.
17 public class NiciraActionSerializerKey {
19 private final short version;
20 private final Class<? extends ActionChoice> subtype;
25 * @param version protocol wire version
26 * @param subtype nx_action_subtype
28 public NiciraActionSerializerKey(final short version, final Class<? extends ActionChoice> subtype) {
29 this.version = version;
30 this.subtype = subtype;
33 public short getVersion() {
37 public Class<? extends ActionChoice> getSubtype() {
42 public int hashCode() {
45 result = prime * result + (subtype == null ? 0 : subtype.hashCode());
46 result = prime * result + version;
51 public boolean equals(final Object obj) {
58 if (getClass() != obj.getClass()) {
61 NiciraActionSerializerKey other = (NiciraActionSerializerKey) obj;
62 if (subtype == null) {
63 if (other.subtype != null) {
66 } else if (!subtype.equals(other.subtype)) {
69 if (version != other.version) {
76 public String toString() {
77 return "NiciraActionSerializerKey [version=" + version + ", subtype=" + subtype + "]";