Class ConvertorProcessor<F extends org.opendaylight.yangtools.yang.binding.DataContainer,T,D extends ConvertorData>
- java.lang.Object
-
- org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.common.ConvertorProcessor<F,T,D>
-
- Type Parameters:
F
- the source typeT
- the result typeD
- the type of convertor data
public class ConvertorProcessor<F extends org.opendaylight.yangtools.yang.binding.DataContainer,T,D extends ConvertorData> extends Object
Processes source and return result based on convertor cases added to this processor.
-
-
Constructor Summary
Constructors Constructor Description ConvertorProcessor()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ConvertorProcessor<F,T,D>
addCase(ConvertorCase<?,T,D> processorCase)
Add convertor processor case.Optional<T>
process(F source, D data, ConvertorExecutor convertorExecutor)
Process source and return result based on convertor cases, or empty if no match is found.Optional<T>
process(F source, ConvertorExecutor convertorExecutor)
Process source and return result based on convertor cases, or empty if no match is found.ConvertorProcessor<F,T,D>
setDefaultCase(ConvertorCase<?,T,D> defaultCase)
Sets default case, what will be used when we do not find any matching convertor case for source.
-
-
-
Method Detail
-
addCase
public ConvertorProcessor<F,T,D> addCase(ConvertorCase<?,T,D> processorCase)
Add convertor processor case.- Parameters:
processorCase
- the processor case- Returns:
- the convertor processor
-
process
public Optional<T> process(F source, ConvertorExecutor convertorExecutor)
Process source and return result based on convertor cases, or empty if no match is found.- Parameters:
source
- the sourceconvertorExecutor
- convertor executor- Returns:
- the optional
-
process
public Optional<T> process(F source, D data, ConvertorExecutor convertorExecutor)
Process source and return result based on convertor cases, or empty if no match is found.- Parameters:
source
- the sourcedata
- the dataconvertorExecutor
- convertor executor- Returns:
- the optional
-
setDefaultCase
public ConvertorProcessor<F,T,D> setDefaultCase(ConvertorCase<?,T,D> defaultCase)
Sets default case, what will be used when we do not find any matching convertor case for source.- Parameters:
defaultCase
- the default case- Returns:
- the default case
-
-