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.rev130731.MatchField;
12 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.OxmClassBase;
13 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.oxm.fields.grouping.MatchEntries;
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<MatchEntries> implements ExperimenterSerializerKey {
23 private Class<C> oxmClass;
24 private Class<F> oxmField;
25 private Long experimenterId;
28 * @param msgVersion protocol wire version
29 * @param objectType class of serialized object
30 * @param oxmClass oxm_class (see specification)
31 * @param oxmField oxm_field (see specification)
33 public MatchEntrySerializerKey(short msgVersion, Class<C> oxmClass,
35 super(msgVersion, MatchEntries.class);
36 this.oxmClass = oxmClass;
37 this.oxmField = oxmField;
41 * @param experimenterId experimenter / vendor ID
43 public void setExperimenterId(Long experimenterId) {
44 this.experimenterId = experimenterId;
48 public int hashCode() {
50 int result = super.hashCode();
51 result = prime * result + ((experimenterId == null) ? 0 : experimenterId.hashCode());
52 result = prime * result + ((oxmClass == null) ? 0 : oxmClass.hashCode());
53 result = prime * result + ((oxmField == null) ? 0 : oxmField.hashCode());
58 public boolean equals(Object obj) {
62 if (!super.equals(obj)) {
65 if (getClass() != obj.getClass()) {
68 MatchEntrySerializerKey<?, ?> other = (MatchEntrySerializerKey<?, ?>) obj;
69 if (experimenterId == null) {
70 if (other.experimenterId != null) {
73 } else if (!experimenterId.equals(other.experimenterId)) {
76 if (oxmClass == null) {
77 if (other.oxmClass != null) {
80 } else if (!oxmClass.equals(other.oxmClass)) {
83 if (oxmField == null) {
84 if (other.oxmField != null) {
87 } else if (!oxmField.equals(other.oxmField)) {
94 public String toString() {
95 return super.toString() + " oxm_class: " + oxmClass.getName() + " oxm_field: "
96 + oxmField.getName() + " experimenterID: " + experimenterId;