/* Generated by camel build tools - do NOT edit this file! */
package org.apache.camel.component.corda;

import java.util.Map;

import org.apache.camel.CamelContext;
import org.apache.camel.spi.ExtendedPropertyConfigurerGetter;
import org.apache.camel.spi.PropertyConfigurerGetter;
import org.apache.camel.spi.ConfigurerStrategy;
import org.apache.camel.spi.GeneratedPropertyConfigurer;
import org.apache.camel.util.CaseInsensitiveMap;
import org.apache.camel.support.component.PropertyConfigurerSupport;

/**
 * Generated by camel build tools - do NOT edit this file!
 */
@SuppressWarnings("unchecked")
public class CordaComponentConfigurer extends PropertyConfigurerSupport implements GeneratedPropertyConfigurer, PropertyConfigurerGetter {

    private org.apache.camel.component.corda.CordaConfiguration getOrCreateConfiguration(CordaComponent target) {
        if (target.getConfiguration() == null) {
            target.setConfiguration(new org.apache.camel.component.corda.CordaConfiguration());
        }
        return target.getConfiguration();
    }

    @Override
    public boolean configure(CamelContext camelContext, Object obj, String name, Object value, boolean ignoreCase) {
        CordaComponent target = (CordaComponent) obj;
        switch (ignoreCase ? name.toLowerCase() : name) {
        case "autowiredenabled":
        case "autowiredEnabled": target.setAutowiredEnabled(property(camelContext, boolean.class, value)); return true;
        case "bridgeerrorhandler":
        case "bridgeErrorHandler": target.setBridgeErrorHandler(property(camelContext, boolean.class, value)); return true;
        case "configuration": target.setConfiguration(property(camelContext, org.apache.camel.component.corda.CordaConfiguration.class, value)); return true;
        case "contractstateclass":
        case "contractStateClass": getOrCreateConfiguration(target).setContractStateClass(property(camelContext, java.lang.Class.class, value)); return true;
        case "flowlogicarguments":
        case "flowLogicArguments": getOrCreateConfiguration(target).setFlowLogicArguments(property(camelContext, java.lang.Object[].class, value)); return true;
        case "flowlogicclass":
        case "flowLogicClass": getOrCreateConfiguration(target).setFlowLogicClass(property(camelContext, java.lang.Class.class, value)); return true;
        case "lazystartproducer":
        case "lazyStartProducer": target.setLazyStartProducer(property(camelContext, boolean.class, value)); return true;
        case "operation": getOrCreateConfiguration(target).setOperation(property(camelContext, java.lang.String.class, value)); return true;
        case "pagespecification":
        case "pageSpecification": getOrCreateConfiguration(target).setPageSpecification(property(camelContext, net.corda.core.node.services.vault.PageSpecification.class, value)); return true;
        case "password": getOrCreateConfiguration(target).setPassword(property(camelContext, java.lang.String.class, value)); return true;
        case "processsnapshot":
        case "processSnapshot": getOrCreateConfiguration(target).setProcessSnapshot(property(camelContext, boolean.class, value)); return true;
        case "querycriteria":
        case "queryCriteria": getOrCreateConfiguration(target).setQueryCriteria(property(camelContext, net.corda.core.node.services.vault.QueryCriteria.class, value)); return true;
        case "sort": getOrCreateConfiguration(target).setSort(property(camelContext, net.corda.core.node.services.vault.Sort.class, value)); return true;
        case "username": getOrCreateConfiguration(target).setUsername(property(camelContext, java.lang.String.class, value)); return true;
        default: return false;
        }
    }

    @Override
    public Class<?> getOptionType(String name, boolean ignoreCase) {
        switch (ignoreCase ? name.toLowerCase() : name) {
        case "autowiredenabled":
        case "autowiredEnabled": return boolean.class;
        case "bridgeerrorhandler":
        case "bridgeErrorHandler": return boolean.class;
        case "configuration": return org.apache.camel.component.corda.CordaConfiguration.class;
        case "contractstateclass":
        case "contractStateClass": return java.lang.Class.class;
        case "flowlogicarguments":
        case "flowLogicArguments": return java.lang.Object[].class;
        case "flowlogicclass":
        case "flowLogicClass": return java.lang.Class.class;
        case "lazystartproducer":
        case "lazyStartProducer": return boolean.class;
        case "operation": return java.lang.String.class;
        case "pagespecification":
        case "pageSpecification": return net.corda.core.node.services.vault.PageSpecification.class;
        case "password": return java.lang.String.class;
        case "processsnapshot":
        case "processSnapshot": return boolean.class;
        case "querycriteria":
        case "queryCriteria": return net.corda.core.node.services.vault.QueryCriteria.class;
        case "sort": return net.corda.core.node.services.vault.Sort.class;
        case "username": return java.lang.String.class;
        default: return null;
        }
    }

    @Override
    public Object getOptionValue(Object obj, String name, boolean ignoreCase) {
        CordaComponent target = (CordaComponent) obj;
        switch (ignoreCase ? name.toLowerCase() : name) {
        case "autowiredenabled":
        case "autowiredEnabled": return target.isAutowiredEnabled();
        case "bridgeerrorhandler":
        case "bridgeErrorHandler": return target.isBridgeErrorHandler();
        case "configuration": return target.getConfiguration();
        case "contractstateclass":
        case "contractStateClass": return getOrCreateConfiguration(target).getContractStateClass();
        case "flowlogicarguments":
        case "flowLogicArguments": return getOrCreateConfiguration(target).getFlowLogicArguments();
        case "flowlogicclass":
        case "flowLogicClass": return getOrCreateConfiguration(target).getFlowLogicClass();
        case "lazystartproducer":
        case "lazyStartProducer": return target.isLazyStartProducer();
        case "operation": return getOrCreateConfiguration(target).getOperation();
        case "pagespecification":
        case "pageSpecification": return getOrCreateConfiguration(target).getPageSpecification();
        case "password": return getOrCreateConfiguration(target).getPassword();
        case "processsnapshot":
        case "processSnapshot": return getOrCreateConfiguration(target).isProcessSnapshot();
        case "querycriteria":
        case "queryCriteria": return getOrCreateConfiguration(target).getQueryCriteria();
        case "sort": return getOrCreateConfiguration(target).getSort();
        case "username": return getOrCreateConfiguration(target).getUsername();
        default: return null;
        }
    }

    @Override
    public Object getCollectionValueType(Object target, String name, boolean ignoreCase) {
        switch (ignoreCase ? name.toLowerCase() : name) {
        case "contractstateclass":
        case "contractStateClass": return net.corda.core.contracts.ContractState.class;
        case "flowlogicclass":
        case "flowLogicClass": return net.corda.core.flows.FlowLogic.class;
        default: return null;
        }
    }
}

