2 * Copyright (c) 2016 ZTE, Inc. 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 org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.ExperimenterMeterBandSubType;
11 import org.opendaylight.yangtools.yang.binding.DataContainer;
14 * Key for an experimenter id meter subtype serializer.
16 * @author hyy on 2016/9/8.
18 public class ExperimenterIdMeterSubTypeSerializerKey<T extends DataContainer> extends ExperimenterIdSerializerKey<T> {
20 private final Class<? extends ExperimenterMeterBandSubType> meterSubType;
25 * @param msgVersion protocol wire version
26 * @param experimenterId experimenter / vendor ID
27 * @param objectClass class of object to be serialized
28 * @param meterSubType vendor defined subtype
30 public ExperimenterIdMeterSubTypeSerializerKey(short msgVersion, long experimenterId,
31 Class<T> objectClass, Class<? extends ExperimenterMeterBandSubType> meterSubType) {
32 super(msgVersion, experimenterId, objectClass);
33 this.meterSubType = meterSubType;
37 public int hashCode() {
39 int result = super.hashCode();
40 result = prime * result + (meterSubType == null ? 0 : meterSubType.hashCode());
45 public boolean equals(Object obj) {
49 if (!super.equals(obj)) {
52 if (getClass() != obj.getClass()) {
55 ExperimenterIdMeterSubTypeSerializerKey other = (ExperimenterIdMeterSubTypeSerializerKey) obj;
56 if (meterSubType == null) {
57 if (other.meterSubType != null) {
60 } else if (!meterSubType.equals(other.meterSubType)) {