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
8 package org.opendaylight.openflowjava.protocol.api.keys;
10 import static java.util.Objects.requireNonNull;
12 import org.opendaylight.yangtools.yang.binding.DataContainer;
13 import org.opendaylight.yangtools.yang.common.Uint32;
14 import org.opendaylight.yangtools.yang.common.Uint8;
17 * Key for an experimenter id serializer.
19 * @author michal.polkorab
20 * @param <T> class of object to be serialized
22 public class ExperimenterIdSerializerKey<T extends DataContainer> extends MessageTypeKey<T>
23 implements ExperimenterSerializerKey {
25 private final Uint32 experimenterId;
30 * @param msgVersion protocol wire version
31 * @param experimenterId experimenter / vendor ID
32 * @param objectClass class of object to be serialized
34 public ExperimenterIdSerializerKey(final Uint8 msgVersion,
35 final Uint32 experimenterId, final Class<T> objectClass) {
36 super(msgVersion, objectClass);
37 this.experimenterId = requireNonNull(experimenterId);
41 public int hashCode() {
43 int result = super.hashCode();
44 result = prime * result + experimenterId.hashCode();
48 protected int hashCodeOfLong(final long longValue) {
49 return (int) (longValue ^ longValue >>> 32);
53 public boolean equals(final Object obj) {
57 if (!super.equals(obj)) {
60 if (!(obj instanceof ExperimenterIdSerializerKey)) {
63 ExperimenterIdSerializerKey<?> other = (ExperimenterIdSerializerKey<?>) obj;
64 if (experimenterId != other.experimenterId) {
71 public String toString() {
72 return super.toString() + " experimenterID: " + experimenterId;