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
9 package org.opendaylight.openflowjava.protocol.api.keys;
11 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.MatchField;
12 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.OxmClassBase;
13 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntry;
16 * @author michal.polkorab
17 * @param <C> oxm_class (see specification)
18 * @param <F> oxm_field (see specification)
20 public final class MatchEntrySerializerKey<C extends OxmClassBase, F extends MatchField>
21 extends MessageTypeKey<MatchEntry> implements ExperimenterSerializerKey {
23 private Class<C> oxmClass;
24 private Class<F> oxmField;
25 private Long experimenterId;
28 * @param msgVersion protocol wire version
29 * @param oxmClass oxm_class (see specification)
30 * @param oxmField oxm_field (see specification)
32 public MatchEntrySerializerKey(short msgVersion, Class<C> oxmClass,
34 super(msgVersion, MatchEntry.class);
35 this.oxmClass = oxmClass;
36 this.oxmField = oxmField;
40 * @param experimenterId experimenter / vendor ID
42 public void setExperimenterId(Long experimenterId) {
43 this.experimenterId = experimenterId;
47 public int hashCode() {
49 int result = super.hashCode();
50 result = prime * result + ((experimenterId == null) ? 0 : experimenterId.hashCode());
51 result = prime * result + ((oxmClass == null) ? 0 : oxmClass.hashCode());
52 result = prime * result + ((oxmField == null) ? 0 : oxmField.hashCode());
57 public boolean equals(Object obj) {
61 if (!super.equals(obj)) {
64 if (getClass() != obj.getClass()) {
67 MatchEntrySerializerKey<?, ?> other = (MatchEntrySerializerKey<?, ?>) obj;
68 if (experimenterId == null) {
69 if (other.experimenterId != null) {
72 } else if (!experimenterId.equals(other.experimenterId)) {
75 if (oxmClass == null) {
76 if (other.oxmClass != null) {
79 } else if (!oxmClass.equals(other.oxmClass)) {
82 if (oxmField == null) {
83 if (other.oxmField != null) {
86 } else if (!oxmField.equals(other.oxmField)) {
93 public String toString() {
94 return super.toString() + " oxm_class: " + oxmClass.getName() + " oxm_field: "
95 + oxmField.getName() + " experimenterID: " + experimenterId;