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 static java.util.Objects.requireNonNull;
12 import java.util.Objects;
13 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.ActionChoice;
14 import org.opendaylight.yangtools.yang.common.Uint8;
17 * Serializer key for a Nicira action.
21 public class NiciraActionSerializerKey {
23 private final Uint8 version;
24 private final Class<? extends ActionChoice> subtype;
29 * @param version protocol wire version
30 * @param subtype nx_action_subtype
32 public NiciraActionSerializerKey(final Uint8 version, final Class<? extends ActionChoice> subtype) {
33 this.version = requireNonNull(version);
34 this.subtype = subtype;
37 public Uint8 getVersion() {
41 public Class<? extends ActionChoice> getSubtype() {
46 public int hashCode() {
49 result = prime * result + Objects.hashCode(subtype);
50 result = prime * result + version.hashCode();
55 public boolean equals(final Object obj) {
62 if (getClass() != obj.getClass()) {
65 NiciraActionSerializerKey other = (NiciraActionSerializerKey) obj;
66 return Objects.equals(subtype, other.subtype) && version.equals(other.version);
70 public String toString() {
71 return "NiciraActionSerializerKey [version=" + version + ", subtype=" + subtype + "]";