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.Collection;
12 import java.util.Optional;
13 import org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.common.ConvertorData;
15 public interface ConvertorExecutor {
17 * Lookup and use convertor by specified type, then converts source and returns converted result.
19 * @param <F> the source type
20 * @param <T> the result type
21 * @param <D> the data type
22 * @param source the source
23 * @param data convertor data
24 * @return the result (can be empty, if no convertor was found)
26 <F, T, D extends ConvertorData> Optional<T> convert(F source, D data);
29 * Lookup and use convertor by specified type, then converts source collection and returns converted result.
31 * @param <F> the source type
32 * @param <T> the result type
33 * @param <D> the data type
34 * @param source the source collection
35 * @param data convertor data
36 * @return the result (can be empty, if no convertor was found)
38 <F, T, D extends ConvertorData> Optional<T> convert(Collection<F> source, D data);