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
18 public class ExperimenterIdDeserializerKey extends MessageCodeKey
19 implements ExperimenterDeserializerKey {
21 private long experimenterId;
24 * @param <E> type of target experimenter object
25 * @param version protocol wire version
26 * @param experimenterId experimenter / vendor ID
27 * @param objectClass class of created object
29 public <E extends DataContainer> ExperimenterIdDeserializerKey(short version,
30 long experimenterId, Class<E> objectClass) {
31 super(version, EncodeConstants.EXPERIMENTER_VALUE, objectClass);
32 this.experimenterId = experimenterId;
35 protected int hashCodeOfLong(long longValue) {
36 return (int) (longValue ^ (longValue >>> 32));
40 public int hashCode() {
42 int result = super.hashCode();
43 result = prime * result + hashCodeOfLong(experimenterId);
48 public boolean equals(Object obj) {
52 if (!super.equals(obj)) {
55 if (!(obj instanceof ExperimenterIdDeserializerKey)) {
58 ExperimenterIdDeserializerKey other = (ExperimenterIdDeserializerKey) obj;
59 if (experimenterId != other.experimenterId) {
66 public String toString() {
67 return super.toString() + " experimenterID: " + experimenterId;