2 * Copyright (c) 2013 Pantheon Technologies s.r.o. 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.openflowjava.protocol.impl.util;
13 * @author michal.polkorab
16 public class TypeToClassInitHelper {
18 private short version;
19 private Map<TypeToClassKey, Class<?>> messageClassMap;
23 * @param version protocol wire version
24 * @param messageClassMap map which stores type to class mapping
26 public TypeToClassInitHelper(short version, Map<TypeToClassKey,
27 Class<?>> messageClassMap) {
28 this.version = version;
29 this.messageClassMap = messageClassMap;
33 * Registers Class int the type to class mapping
34 * @param type code value for message type / class
35 * @param clazz corresponding code -> class
37 public void registerTypeToClass(short type, Class<?> clazz) {
38 messageClassMap.put(new TypeToClassKey(version, type), clazz);