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.impl.deserialization;
\r
10 import org.opendaylight.openflowjava.protocol.api.extensibility.MessageTypeKey;
\r
11 import org.opendaylight.openflowjava.protocol.api.extensibility.SerializerRegistry;
\r
14 * More specific key for {@link SerializerRegistry}
\r
15 * @author michal.polkorab
\r
16 * @param <E> main type
\r
17 * @param <F> specific type
\r
19 public class EnhancedMessageTypeKey<E, F> extends MessageTypeKey<E> {
\r
21 private final Class<F> msgType2;
\r
28 public EnhancedMessageTypeKey(short msgVersion, Class<E> msgType, Class<F> msgType2) {
\r
29 super(msgVersion, msgType);
\r
30 this.msgType2 = msgType2;
\r
34 * @return more specific type
\r
36 public Class<F> getMsgType2() {
\r
41 public boolean equals(Object obj) {
\r
44 if (!super.equals(obj))
\r
46 if (getClass() != obj.getClass())
\r
48 @SuppressWarnings("rawtypes")
\r
49 EnhancedMessageTypeKey other = (EnhancedMessageTypeKey) obj;
\r
50 if (msgType2 == null) {
\r
51 if (other.msgType2 != null)
\r
53 } else if (!msgType2.equals(other.msgType2))
\r
59 public String toString() {
\r
60 return super.toString() + " msgType2: " + msgType2.getName();
\r