Class ConvertorProcessor<F extends org.opendaylight.yangtools.yang.binding.DataContainer,​T,​D extends ConvertorData>

  • Type Parameters:
    F - the source type
    T - the result type
    D - 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 Detail

      • ConvertorProcessor

        public ConvertorProcessor()
    • 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 source
        convertorExecutor - 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 source
        data - the data
        convertorExecutor - 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