X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=openflow-protocol-api%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fopenflowjava%2Fprotocol%2Fapi%2Fkeys%2Fexperimenter%2FExperimenterIdSerializerKey.java;h=1718246ce25e16586b6954bb5d18462b210a38e4;hb=519a86d1ddcfb8f0fe264174e62e5424e1efba1f;hp=47d3608a3439579f8d99ff99341accb5d92ec2c4;hpb=e3261ca20db3ad074c2c548c1a29f3e004e79f22;p=openflowjava.git diff --git a/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/keys/experimenter/ExperimenterIdSerializerKey.java b/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/keys/experimenter/ExperimenterIdSerializerKey.java index 47d3608a..1718246c 100644 --- a/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/keys/experimenter/ExperimenterIdSerializerKey.java +++ b/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/keys/experimenter/ExperimenterIdSerializerKey.java @@ -1,63 +1,68 @@ -/* - * Copyright (c) 2014 Pantheon Technologies s.r.o. and others. All rights reserved. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0 which accompanies this distribution, - * and is available at http://www.eclipse.org/legal/epl-v10.html - */ - -package org.opendaylight.openflowjava.protocol.api.keys.experimenter; - -import org.opendaylight.openflowjava.protocol.api.extensibility.MessageTypeKey; -import org.opendaylight.yangtools.yang.binding.DataObject; - -/** - * @author michal.polkorab - * @param class of object to be serialized - */ -public class ExperimenterIdSerializerKey extends MessageTypeKey - implements ExperimenterSerializerKey { - - private Long experimenterId; - - /** - * @param msgVersion protocol wire version - * @param experimenterId experimenter / vendor ID - * @param objectClass class of object to be serialized - */ - public ExperimenterIdSerializerKey(short msgVersion, - Long experimenterId, Class objectClass) { - super(msgVersion, objectClass); - this.experimenterId = experimenterId; - } - - @Override - public int hashCode() { - final int prime = 31; - int result = super.hashCode(); - result = prime * result + ((experimenterId == null) ? 0 : experimenterId.hashCode()); - return result; - } - - @Override - public boolean equals(Object obj) { - if (this == obj) - return true; - if (!super.equals(obj)) - return false; - if (!(obj instanceof ExperimenterIdSerializerKey)) - return false; - ExperimenterIdSerializerKey other = (ExperimenterIdSerializerKey) obj; - if (experimenterId == null) { - if (other.experimenterId != null) - return false; - } else if (!experimenterId.equals(other.experimenterId)) - return false; - return true; - } - - @Override - public String toString() { - return super.toString() + " experimenterID: " + experimenterId; - } +/* + * Copyright (c) 2014 Pantheon Technologies s.r.o. and others. All rights reserved. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v1.0 which accompanies this distribution, + * and is available at http://www.eclipse.org/legal/epl-v10.html + */ + +package org.opendaylight.openflowjava.protocol.api.keys.experimenter; + +import org.opendaylight.openflowjava.protocol.api.extensibility.MessageTypeKey; +import org.opendaylight.yangtools.yang.binding.DataObject; + +/** + * @author michal.polkorab + * @param class of object to be serialized + */ +public class ExperimenterIdSerializerKey extends MessageTypeKey + implements ExperimenterSerializerKey { + + private Long experimenterId; + + /** + * @param msgVersion protocol wire version + * @param experimenterId experimenter / vendor ID + * @param objectClass class of object to be serialized + */ + public ExperimenterIdSerializerKey(short msgVersion, + Long experimenterId, Class objectClass) { + super(msgVersion, objectClass); + this.experimenterId = experimenterId; + } + + @Override + public int hashCode() { + final int prime = 31; + int result = super.hashCode(); + result = prime * result + ((experimenterId == null) ? 0 : experimenterId.hashCode()); + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!super.equals(obj)) { + return false; + } + if (!(obj instanceof ExperimenterIdSerializerKey)) { + return false; + } + ExperimenterIdSerializerKey other = (ExperimenterIdSerializerKey) obj; + if (experimenterId == null) { + if (other.experimenterId != null) { + return false; + } + } else if (!experimenterId.equals(other.experimenterId)) { + return false; + } + return true; + } + + @Override + public String toString() { + return super.toString() + " experimenterID: " + experimenterId; + } } \ No newline at end of file