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 javax.annotation.Nullable;
12 import org.opendaylight.yangtools.yang.binding.DataContainer;
15 * Converts OpenflowJava to MDSal model and vice versa
17 * @param <FROM> type of source
18 * @param <TO> type of result
20 public interface Convertor<FROM, TO, DATA extends ConvertorData> {
23 * Gets type of convertor, used in
24 * {@link org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.ConvertorManager}.
26 * @return the type of convertor
28 Class<? extends DataContainer> getType();
31 * Converts source to result
33 * @param source source
34 * @param data convertor data
35 * @return converted source
37 TO convert(FROM source, @Nullable DATA data);