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

import javax.annotation.processing.Generated;
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!
 */
@Generated("org.apache.camel.maven.packaging.EndpointSchemaGeneratorMojo")
@SuppressWarnings("unchecked")
public class ConsulComponentConfigurer extends PropertyConfigurerSupport implements GeneratedPropertyConfigurer, PropertyConfigurerGetter {

    private org.apache.camel.component.consul.ConsulConfiguration getOrCreateConfiguration(ConsulComponent target) {
        if (target.getConfiguration() == null) {
            target.setConfiguration(new org.apache.camel.component.consul.ConsulConfiguration());
        }
        return target.getConfiguration();
    }

    @Override
    public boolean configure(CamelContext camelContext, Object obj, String name, Object value, boolean ignoreCase) {
        ConsulComponent target = (ConsulComponent) obj;
        switch (ignoreCase ? name.toLowerCase() : name) {
        case "acltoken":
        case "aclToken": getOrCreateConfiguration(target).setAclToken(property(camelContext, java.lang.String.class, value)); return true;
        case "action": getOrCreateConfiguration(target).setAction(property(camelContext, java.lang.String.class, value)); return true;
        case "autowiredenabled":
        case "autowiredEnabled": target.setAutowiredEnabled(property(camelContext, boolean.class, value)); return true;
        case "blockseconds":
        case "blockSeconds": getOrCreateConfiguration(target).setBlockSeconds(property(camelContext, java.lang.Integer.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.consul.ConsulConfiguration.class, value)); return true;
        case "connecttimeout":
        case "connectTimeout": getOrCreateConfiguration(target).setConnectTimeout(property(camelContext, java.time.Duration.class, value)); return true;
        case "consistencymode":
        case "consistencyMode": getOrCreateConfiguration(target).setConsistencyMode(property(camelContext, org.kiwiproject.consul.option.ConsistencyMode.class, value)); return true;
        case "consulclient":
        case "consulClient": getOrCreateConfiguration(target).setConsulClient(property(camelContext, org.kiwiproject.consul.Consul.class, value)); return true;
        case "datacenter": getOrCreateConfiguration(target).setDatacenter(property(camelContext, java.lang.String.class, value)); return true;
        case "firstindex":
        case "firstIndex": getOrCreateConfiguration(target).setFirstIndex(property(camelContext, java.math.BigInteger.class, value)); return true;
        case "key": getOrCreateConfiguration(target).setKey(property(camelContext, java.lang.String.class, value)); return true;
        case "lazystartproducer":
        case "lazyStartProducer": target.setLazyStartProducer(property(camelContext, boolean.class, value)); return true;
        case "nearnode":
        case "nearNode": getOrCreateConfiguration(target).setNearNode(property(camelContext, java.lang.String.class, value)); return true;
        case "nodemeta":
        case "nodeMeta": getOrCreateConfiguration(target).setNodeMeta(property(camelContext, java.lang.String.class, value)); return true;
        case "password": getOrCreateConfiguration(target).setPassword(property(camelContext, java.lang.String.class, value)); return true;
        case "pinginstance":
        case "pingInstance": getOrCreateConfiguration(target).setPingInstance(property(camelContext, boolean.class, value)); return true;
        case "readtimeout":
        case "readTimeout": getOrCreateConfiguration(target).setReadTimeout(property(camelContext, java.time.Duration.class, value)); return true;
        case "recursive": getOrCreateConfiguration(target).setRecursive(property(camelContext, boolean.class, value)); return true;
        case "sslcontextparameters":
        case "sslContextParameters": getOrCreateConfiguration(target).setSslContextParameters(property(camelContext, org.apache.camel.support.jsse.SSLContextParameters.class, value)); return true;
        case "tags": getOrCreateConfiguration(target).setTags(property(camelContext, java.lang.String.class, value)); return true;
        case "url": getOrCreateConfiguration(target).setUrl(property(camelContext, java.lang.String.class, value)); return true;
        case "useglobalsslcontextparameters":
        case "useGlobalSslContextParameters": target.setUseGlobalSslContextParameters(property(camelContext, boolean.class, value)); return true;
        case "username":
        case "userName": getOrCreateConfiguration(target).setUserName(property(camelContext, java.lang.String.class, value)); return true;
        case "valueasstring":
        case "valueAsString": getOrCreateConfiguration(target).setValueAsString(property(camelContext, boolean.class, value)); return true;
        case "writetimeout":
        case "writeTimeout": getOrCreateConfiguration(target).setWriteTimeout(property(camelContext, java.time.Duration.class, value)); return true;
        default: return false;
        }
    }

    @Override
    public String[] getAutowiredNames() {
        return new String[]{"consulClient"};
    }

    @Override
    public Class<?> getOptionType(String name, boolean ignoreCase) {
        switch (ignoreCase ? name.toLowerCase() : name) {
        case "acltoken":
        case "aclToken": return java.lang.String.class;
        case "action": return java.lang.String.class;
        case "autowiredenabled":
        case "autowiredEnabled": return boolean.class;
        case "blockseconds":
        case "blockSeconds": return java.lang.Integer.class;
        case "bridgeerrorhandler":
        case "bridgeErrorHandler": return boolean.class;
        case "configuration": return org.apache.camel.component.consul.ConsulConfiguration.class;
        case "connecttimeout":
        case "connectTimeout": return java.time.Duration.class;
        case "consistencymode":
        case "consistencyMode": return org.kiwiproject.consul.option.ConsistencyMode.class;
        case "consulclient":
        case "consulClient": return org.kiwiproject.consul.Consul.class;
        case "datacenter": return java.lang.String.class;
        case "firstindex":
        case "firstIndex": return java.math.BigInteger.class;
        case "key": return java.lang.String.class;
        case "lazystartproducer":
        case "lazyStartProducer": return boolean.class;
        case "nearnode":
        case "nearNode": return java.lang.String.class;
        case "nodemeta":
        case "nodeMeta": return java.lang.String.class;
        case "password": return java.lang.String.class;
        case "pinginstance":
        case "pingInstance": return boolean.class;
        case "readtimeout":
        case "readTimeout": return java.time.Duration.class;
        case "recursive": return boolean.class;
        case "sslcontextparameters":
        case "sslContextParameters": return org.apache.camel.support.jsse.SSLContextParameters.class;
        case "tags": return java.lang.String.class;
        case "url": return java.lang.String.class;
        case "useglobalsslcontextparameters":
        case "useGlobalSslContextParameters": return boolean.class;
        case "username":
        case "userName": return java.lang.String.class;
        case "valueasstring":
        case "valueAsString": return boolean.class;
        case "writetimeout":
        case "writeTimeout": return java.time.Duration.class;
        default: return null;
        }
    }

    @Override
    public Object getOptionValue(Object obj, String name, boolean ignoreCase) {
        ConsulComponent target = (ConsulComponent) obj;
        switch (ignoreCase ? name.toLowerCase() : name) {
        case "acltoken":
        case "aclToken": return getOrCreateConfiguration(target).getAclToken();
        case "action": return getOrCreateConfiguration(target).getAction();
        case "autowiredenabled":
        case "autowiredEnabled": return target.isAutowiredEnabled();
        case "blockseconds":
        case "blockSeconds": return getOrCreateConfiguration(target).getBlockSeconds();
        case "bridgeerrorhandler":
        case "bridgeErrorHandler": return target.isBridgeErrorHandler();
        case "configuration": return target.getConfiguration();
        case "connecttimeout":
        case "connectTimeout": return getOrCreateConfiguration(target).getConnectTimeout();
        case "consistencymode":
        case "consistencyMode": return getOrCreateConfiguration(target).getConsistencyMode();
        case "consulclient":
        case "consulClient": return getOrCreateConfiguration(target).getConsulClient();
        case "datacenter": return getOrCreateConfiguration(target).getDatacenter();
        case "firstindex":
        case "firstIndex": return getOrCreateConfiguration(target).getFirstIndex();
        case "key": return getOrCreateConfiguration(target).getKey();
        case "lazystartproducer":
        case "lazyStartProducer": return target.isLazyStartProducer();
        case "nearnode":
        case "nearNode": return getOrCreateConfiguration(target).getNearNode();
        case "nodemeta":
        case "nodeMeta": return getOrCreateConfiguration(target).getNodeMeta();
        case "password": return getOrCreateConfiguration(target).getPassword();
        case "pinginstance":
        case "pingInstance": return getOrCreateConfiguration(target).isPingInstance();
        case "readtimeout":
        case "readTimeout": return getOrCreateConfiguration(target).getReadTimeout();
        case "recursive": return getOrCreateConfiguration(target).isRecursive();
        case "sslcontextparameters":
        case "sslContextParameters": return getOrCreateConfiguration(target).getSslContextParameters();
        case "tags": return getOrCreateConfiguration(target).getTags();
        case "url": return getOrCreateConfiguration(target).getUrl();
        case "useglobalsslcontextparameters":
        case "useGlobalSslContextParameters": return target.isUseGlobalSslContextParameters();
        case "username":
        case "userName": return getOrCreateConfiguration(target).getUserName();
        case "valueasstring":
        case "valueAsString": return getOrCreateConfiguration(target).isValueAsString();
        case "writetimeout":
        case "writeTimeout": return getOrCreateConfiguration(target).getWriteTimeout();
        default: return null;
        }
    }
}

