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 * Created by hyy on 2016/9/8.
16 public class ExperimenterIdMeterSubTypeSerializerKey<T extends DataContainer> extends ExperimenterIdSerializerKey<T> {
18 private Class<? extends ExperimenterMeterBandSubType> meterSubType;
21 * @param msgVersion protocol wire version
22 * @param experimenterId experimenter / vendor ID
23 * @param objectClass class of object to be serialized
24 * @param meterSubType vendor defined subtype
26 public ExperimenterIdMeterSubTypeSerializerKey(short msgVersion, long experimenterId,
27 Class<T> objectClass, Class<? extends ExperimenterMeterBandSubType> meterSubType) {
28 super(msgVersion, experimenterId, objectClass);
29 this.meterSubType = meterSubType;
33 public int hashCode() {
35 int result = super.hashCode();
36 result = prime * result + ((meterSubType == null) ? 0 : meterSubType.hashCode());
41 public boolean equals(Object obj) {
45 if (!super.equals(obj)) {
48 if (getClass() != obj.getClass()) {
51 ExperimenterIdMeterSubTypeSerializerKey other = (ExperimenterIdMeterSubTypeSerializerKey) obj;
52 if (meterSubType == null) {
53 if (other.meterSubType != null) {
56 } else if (!meterSubType.equals(other.meterSubType)) {