/* Generated by camel build tools - do NOT edit this file! */
package org.openehealth.ipf.platform.camel.cda.converter;

import org.apache.camel.TypeConverterLoaderException;
import org.apache.camel.spi.TypeConverterLoader;
import org.apache.camel.spi.TypeConverterRegistry;
import org.apache.camel.support.SimpleTypeConverter;

/**
 * Generated by camel build tools - do NOT edit this file!
 */
public final class MdhtTypeConverterLoader implements TypeConverterLoader {

    public MdhtTypeConverterLoader() {
    }

    @Override
    public void load(TypeConverterRegistry registry) throws TypeConverterLoaderException {
        registerConverters(registry);
    }

    private void registerConverters(TypeConverterRegistry registry) {
        addTypeConverter(registry, java.io.InputStream.class, org.openhealthtools.mdht.uml.cda.ClinicalDocument.class, false,
            (type, exchange, value) -> org.openehealth.ipf.platform.camel.cda.converter.MdhtTypeConverter.toInputStream((org.openhealthtools.mdht.uml.cda.ClinicalDocument) value, exchange));
        addTypeConverter(registry, java.lang.String.class, org.openhealthtools.mdht.uml.cda.ClinicalDocument.class, false,
            (type, exchange, value) -> org.openehealth.ipf.platform.camel.cda.converter.MdhtTypeConverter.toString((org.openhealthtools.mdht.uml.cda.ClinicalDocument) value, exchange));
    }

    private static void addTypeConverter(TypeConverterRegistry registry, Class<?> toType, Class<?> fromType, boolean allowNull, SimpleTypeConverter.ConversionMethod method) { 
        registry.addTypeConverter(toType, fromType, new SimpleTypeConverter(allowNull, method));
    }

}
