2 * Copyright (c) 2016 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
9 package org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.common;
11 import java.util.Collection;
12 import org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.ConvertorExecutor;
13 import org.opendaylight.yangtools.yang.binding.DataContainer;
16 * Converts OpenflowJava to MDSal model and vice versa
18 * @param <FROM> type of source
19 * @param <TO> type of result
20 * @param <DATA> the type parameter
22 public abstract class Convertor<FROM, TO, DATA extends ConvertorData> {
23 private ConvertorExecutor convertorExecutor;
26 * Gets convertor manager.
28 * @return the convertor manager
30 protected ConvertorExecutor getConvertorExecutor() {
31 return convertorExecutor;
35 * Sets convertor manager.
37 * @param convertorExecutor the convertor manager
39 public void setConvertorExecutor(ConvertorExecutor convertorExecutor) {
40 this.convertorExecutor = convertorExecutor;
44 * Gets type of convertor, used in
45 * {@link org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.ConvertorManager}.
47 * @return the type of convertor
49 public abstract Collection<Class<? extends DataContainer>> getTypes();
52 * Converts source to result
54 * @param source source
55 * @param data convertor data
56 * @return converted source
58 public abstract TO convert(FROM source, DATA data);