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 boolean equals(Object obj) {
\r
35 if (!super.equals(obj))
\r
37 if (getClass() != obj.getClass())
\r
39 @SuppressWarnings("rawtypes")
\r
40 EnhancedMessageTypeKey other = (EnhancedMessageTypeKey) obj;
\r
41 if (msgType2 == null) {
\r
42 if (other.msgType2 != null)
\r
44 } else if (!msgType2.getName().equals(other.msgType2.getName()))
\r
50 public String toString() {
\r
51 return super.toString() + " msgType2: " + msgType2.getName();
\r