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;
11 import java.util.Optional;
12 import org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.common.ConvertorData;
14 public interface ConvertorExecutor {
16 * Lookup and use convertor by specified type, then converts source and returns converted result
18 * @param <FROM> the source type
19 * @param <TO> the result type
20 * @param source the source
21 * @return the result (can be empty, if no convertor was found)
23 <FROM, TO> Optional<TO> convert(final FROM source);
26 * Lookup and use convertor by specified type, then converts source and returns converted result
28 * @param <FROM> the source type
29 * @param <TO> the result type
30 * @param <DATA> the data type
31 * @param source the source
32 * @param data convertor data
33 * @return the result (can be empty, if no convertor was found)
35 <FROM, TO, DATA extends ConvertorData> Optional<TO> convert(final FROM source, final DATA data);