2 * Copyright (c) 2014 Cisco Systems, 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.openflowplugin.extension.api;
12 * lookup and register key for extension converters, basic case expects this to
13 * correlate with input model type
15 * @param <T> type of key
17 public class TypeVersionKey<T> {
19 private Class<? extends T> type;
20 private short ofVersion;
26 public TypeVersionKey(Class<? extends T> type, short ofVersion) {
28 this.ofVersion = ofVersion;
34 public Class<? extends T> getType() {
39 public int hashCode() {
42 result = prime * result + ofVersion;
43 result = prime * result + ((type == null) ? 0 : type.hashCode());
48 public boolean equals(Object obj) {
55 if (getClass() != obj.getClass()) {
58 TypeVersionKey<?> other = (TypeVersionKey<?>) obj;
59 if (ofVersion != other.ofVersion) {
63 if (other.type != null)
65 } else if (!type.equals(other.type))