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.yangtools.yang.binding.DataContainer;
14 * @author michal.polkorab
15 * @param <T> class of object to be serialized
17 public class ExperimenterIdSerializerKey<T extends DataContainer> extends MessageTypeKey<T>
18 implements ExperimenterSerializerKey {
20 private long experimenterId;
23 * @param msgVersion protocol wire version
24 * @param experimenterId experimenter / vendor ID
25 * @param objectClass class of object to be serialized
27 public ExperimenterIdSerializerKey(short msgVersion,
28 long experimenterId, Class<T> objectClass) {
29 super(msgVersion, objectClass);
30 this.experimenterId = experimenterId;
34 public int hashCode() {
36 int result = super.hashCode();
37 result = prime * result + hashCodeOfLong(experimenterId);
41 protected int hashCodeOfLong(long longValue) {
42 return (int) (longValue ^ (longValue >>> 32));
46 public boolean equals(Object obj) {
50 if (!super.equals(obj)) {
53 if (!(obj instanceof ExperimenterIdSerializerKey)) {
56 ExperimenterIdSerializerKey<?> other = (ExperimenterIdSerializerKey<?>) obj;
57 if (experimenterId != other.experimenterId) {
64 public String toString() {
65 return super.toString() + " experimenterID: " + experimenterId;