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.openflowjava.protocol.api.util.EncodeConstants;
12 import org.opendaylight.yangtools.yang.binding.DataContainer;
15 * @author michal.polkorab
17 public class ExperimenterIdDeserializerKey extends MessageCodeKey implements ExperimenterDeserializerKey {
19 private long experimenterId;
22 * @param <E> type of target experimenter object
23 * @param version protocol wire version
24 * @param experimenterId experimenter / vendor ID
25 * @param objectClass class of created object
27 public <E extends DataContainer> ExperimenterIdDeserializerKey(final short version, final long experimenterId,
28 final Class<E> objectClass) {
29 super(version, EncodeConstants.EXPERIMENTER_VALUE, objectClass);
30 this.experimenterId = experimenterId;
33 protected int hashCodeOfLong(long longValue) {
34 return (int) (longValue ^ (longValue >>> 32));
38 public int hashCode() {
40 int result = super.hashCode();
41 result = prime * result + hashCodeOfLong(experimenterId);
46 public boolean equals(Object obj) {
50 if (!super.equals(obj)) {
53 if (!(obj instanceof ExperimenterIdDeserializerKey)) {
56 ExperimenterIdDeserializerKey other = (ExperimenterIdDeserializerKey) obj;
57 if (experimenterId != other.experimenterId) {
64 public String toString() {
65 return super.toString() + " experimenterID: " + experimenterId;