2 * Copyright (c) 2016 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.openflowplugin.impl.protocol.serialization.match;
11 import org.opendaylight.openflowplugin.api.openflow.protocol.serialization.MatchEntrySerializerKey;
13 public class MatchEntrySerializerKeyImpl implements MatchEntrySerializerKey {
15 private final short version;
16 private final int oxmClass;
17 private final int oxmField;
20 * Create new instance of MatchEntrySerializerKeyImpl.
22 * @param version openflow version
23 * @param oxmClass match entry oxm class
24 * @param oxmField match entry field code
26 public MatchEntrySerializerKeyImpl(final short version, final int oxmClass, final int oxmField) {
27 this.version = version;
28 this.oxmClass = oxmClass;
29 this.oxmField = oxmField;
33 public int hashCode() {
36 result = prime * result + oxmClass;
37 result = prime * result + oxmField;
38 result = prime * result + version;
43 public boolean equals(Object obj) {
52 if (!(obj instanceof MatchEntrySerializerKeyImpl)) {
56 final MatchEntrySerializerKeyImpl other = (MatchEntrySerializerKeyImpl) obj;
59 return oxmClass == other.oxmClass
60 && oxmField == other.oxmField
61 && version == other.version;
66 public String toString() {
67 return "version: " + version
68 + " oxmClass:" + oxmClass
69 + " oxmField: " + oxmField;