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 * Key for an experimenter id serializer.
16 * @author michal.polkorab
17 * @param <T> class of object to be serialized
19 public class ExperimenterIdSerializerKey<T extends DataContainer> extends MessageTypeKey<T>
20 implements ExperimenterSerializerKey {
22 private final long experimenterId;
27 * @param msgVersion protocol wire version
28 * @param experimenterId experimenter / vendor ID
29 * @param objectClass class of object to be serialized
31 public ExperimenterIdSerializerKey(short msgVersion,
32 long experimenterId, Class<T> objectClass) {
33 super(msgVersion, objectClass);
34 this.experimenterId = experimenterId;
38 public int hashCode() {
40 int result = super.hashCode();
41 result = prime * result + hashCodeOfLong(experimenterId);
45 protected int hashCodeOfLong(long longValue) {
46 return (int) (longValue ^ longValue >>> 32);
50 public boolean equals(Object obj) {
54 if (!super.equals(obj)) {
57 if (!(obj instanceof ExperimenterIdSerializerKey)) {
60 ExperimenterIdSerializerKey<?> other = (ExperimenterIdSerializerKey<?>) obj;
61 if (experimenterId != other.experimenterId) {
68 public String toString() {
69 return super.toString() + " experimenterID: " + experimenterId;