2 * Copyright (c) 2014 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
8 package org.opendaylight.openflowjava.protocol.api.keys;
10 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntry;
11 import org.opendaylight.yangtools.yang.common.Uint32;
14 * Key for a match entry deserializer.
16 * @author michal.polkorab
18 public final class MatchEntryDeserializerKey extends MessageCodeKey
19 implements ExperimenterDeserializerKey {
21 private final int oxmField;
22 private Uint32 experimenterId;
27 * @param version protocol wire version
28 * @param oxmClass oxm_class (see specification)
29 * @param oxmField oxm_field (see specification)
31 public MatchEntryDeserializerKey(final short version, final int oxmClass, final int oxmField) {
32 super(version, oxmClass, MatchEntry.class);
33 this.oxmField = oxmField;
37 * Sets the experimenter id.
39 * @param experimenterId experimenter / vendor ID
41 public void setExperimenterId(final Uint32 experimenterId) {
42 this.experimenterId = experimenterId;
46 public int hashCode() {
48 int result = super.hashCode();
49 result = prime * result + (experimenterId == null ? 0 : experimenterId.hashCode());
50 result = prime * result + oxmField;
55 public boolean equals(final Object obj) {
59 if (!super.equals(obj)) {
62 if (getClass() != obj.getClass()) {
65 MatchEntryDeserializerKey other = (MatchEntryDeserializerKey) obj;
66 if (experimenterId == null) {
67 if (other.experimenterId != null) {
70 } else if (!experimenterId.equals(other.experimenterId)) {
73 if (oxmField != other.oxmField) {
80 public String toString() {
81 return super.toString() + " oxm_field: " + oxmField + " experimenterID: " + experimenterId;