2 * Copyright (c) 2014 Pantheon Technologies s.r.o. and others. All rights reserved.
\r
4 * This program and the accompanying materials are made available under the
\r
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
\r
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
\r
9 package org.opendaylight.openflowjava.protocol.api.extensibility.keys;
\r
11 import org.opendaylight.openflowjava.protocol.api.extensibility.MessageTypeKey;
\r
12 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.Clazz;
\r
13 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.MatchField;
\r
14 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.oxm.fields.grouping.MatchEntries;
\r
17 * @author michal.polkorab
\r
18 * @param <OXM_CLASS> oxm_class (see specification)
\r
19 * @param <OXM_FIELD> oxm_field (see specification)
\r
21 public class MatchEntrySerializerKey<OXM_CLASS extends Clazz,
\r
22 OXM_FIELD extends MatchField> extends MessageTypeKey<MatchEntries>{
\r
24 private Class<OXM_CLASS> oxmClass;
\r
25 private Class<OXM_FIELD> oxmField;
\r
26 private Long experimenterId;
\r
29 * @param msgVersion protocol wire version
\r
30 * @param objectType class of serialized object
\r
31 * @param oxmClass oxm_class (see specification)
\r
32 * @param oxmField oxm_field (see specification)
\r
34 public MatchEntrySerializerKey(short msgVersion, Class<OXM_CLASS> oxmClass,
\r
35 Class<OXM_FIELD> oxmField) {
\r
36 super(msgVersion, MatchEntries.class);
\r
37 this.oxmClass = oxmClass;
\r
38 this.oxmField = oxmField;
\r
42 * @param experimenterId experimenter / vendor ID
\r
44 public void setExperimenterId(Long experimenterId) {
\r
45 this.experimenterId = experimenterId;
\r
49 public boolean equals(Object obj) {
\r
52 if (!super.equals(obj))
\r
54 if (getClass() != obj.getClass())
\r
56 @SuppressWarnings("rawtypes")
\r
57 MatchEntrySerializerKey other = (MatchEntrySerializerKey) obj;
\r
58 if (experimenterId == null) {
\r
59 if (other.experimenterId != null)
\r
61 } else if (!experimenterId.equals(other.experimenterId))
\r
63 if (oxmClass == null) {
\r
64 if (other.oxmClass != null)
\r
66 } else if (!oxmClass.equals(other.oxmClass))
\r
68 if (oxmField == null) {
\r
69 if (other.oxmField != null)
\r
71 } else if (!oxmField.equals(other.oxmField))
\r
77 public String toString() {
\r
78 return super.toString() + " oxm_class: " + oxmClass.getName() + " oxm_field: "
\r
79 + oxmField.getName() + " experimenterID: " + experimenterId;
\r