2 * Copyright (c) 2013 Pantheon Technologies s.r.o. and others. All rights reserved.
\r
4 * This program and the accompanying materials are made available under the
\r
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
\r
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
\r
8 package org.opendaylight.openflowjava.protocol.api.extensibility;
\r
12 * More specific key for {@link SerializerRegistry}
\r
13 * @author michal.polkorab
\r
14 * @param <E> main type
\r
15 * @param <F> specific type
\r
17 public class EnhancedMessageTypeKey<E, F> extends MessageTypeKey<E> {
\r
19 private final Class<F> msgType2;
\r
26 public EnhancedMessageTypeKey(short msgVersion, Class<E> msgType, Class<F> msgType2) {
\r
27 super(msgVersion, msgType);
\r
28 this.msgType2 = msgType2;
\r
32 public int hashCode() {
\r
33 final int prime = 31;
\r
34 int result = super.hashCode();
\r
35 result = prime * result + ((msgType2 == null) ? 0 : msgType2.hashCode());
\r
40 public boolean equals(Object obj) {
\r
44 if (!super.equals(obj)) {
\r
47 if (getClass() != obj.getClass()) {
\r
50 @SuppressWarnings("rawtypes")
\r
51 EnhancedMessageTypeKey other = (EnhancedMessageTypeKey) obj;
\r
52 if (msgType2 == null) {
\r
53 if (other.msgType2 != null) {
\r
56 } else if (!msgType2.getName().equals(other.msgType2.getName())) {
\r
63 public String toString() {
\r
64 return super.toString() + " msgType2: " + msgType2.getName();
\r