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.experimenter;
11 import org.opendaylight.openflowjava.protocol.api.extensibility.MessageTypeKey;
12 import org.opendaylight.yangtools.yang.binding.DataObject;
15 * @author michal.polkorab
16 * @param <T> class of object to be serialized
18 public class ExperimenterIdSerializerKey<T extends DataObject> extends MessageTypeKey<T>
19 implements ExperimenterSerializerKey {
21 private Long experimenterId;
24 * @param msgVersion protocol wire version
25 * @param experimenterId experimenter / vendor ID
26 * @param objectClass class of object to be serialized
28 public ExperimenterIdSerializerKey(short msgVersion,
29 Long experimenterId, Class<T> objectClass) {
30 super(msgVersion, objectClass);
31 this.experimenterId = experimenterId;
35 public int hashCode() {
37 int result = super.hashCode();
38 result = prime * result + ((experimenterId == null) ? 0 : experimenterId.hashCode());
43 public boolean equals(Object obj) {
47 if (!super.equals(obj)) {
50 if (!(obj instanceof ExperimenterIdSerializerKey)) {
53 ExperimenterIdSerializerKey<?> other = (ExperimenterIdSerializerKey<?>) obj;
54 if (experimenterId == null) {
55 if (other.experimenterId != null) {
58 } else if (!experimenterId.equals(other.experimenterId)) {
65 public String toString() {
66 return super.toString() + " experimenterID: " + experimenterId;