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

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 QueueComponentConfigurer extends PropertyConfigurerSupport implements GeneratedPropertyConfigurer, PropertyConfigurerGetter {

    private org.apache.camel.component.azure.storage.queue.QueueConfiguration getOrCreateConfiguration(QueueComponent target) {
        if (target.getConfiguration() == null) {
            target.setConfiguration(new org.apache.camel.component.azure.storage.queue.QueueConfiguration());
        }
        return target.getConfiguration();
    }

    @Override
    public boolean configure(CamelContext camelContext, Object obj, String name, Object value, boolean ignoreCase) {
        QueueComponent target = (QueueComponent) obj;
        switch (ignoreCase ? name.toLowerCase() : name) {
        case "accesskey":
        case "accessKey": getOrCreateConfiguration(target).setAccessKey(property(camelContext, java.lang.String.class, value)); return true;
        case "autodiscoverclient":
        case "autoDiscoverClient": getOrCreateConfiguration(target).setAutoDiscoverClient(property(camelContext, boolean.class, value)); return true;
        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.azure.storage.queue.QueueConfiguration.class, value)); return true;
        case "createqueue":
        case "createQueue": getOrCreateConfiguration(target).setCreateQueue(property(camelContext, boolean.class, value)); return true;
        case "credentials": getOrCreateConfiguration(target).setCredentials(property(camelContext, com.azure.storage.common.StorageSharedKeyCredential.class, value)); return true;
        case "lazystartproducer":
        case "lazyStartProducer": target.setLazyStartProducer(property(camelContext, boolean.class, value)); return true;
        case "maxmessages":
        case "maxMessages": getOrCreateConfiguration(target).setMaxMessages(property(camelContext, java.lang.Integer.class, value)); return true;
        case "messageid":
        case "messageId": getOrCreateConfiguration(target).setMessageId(property(camelContext, java.lang.String.class, value)); return true;
        case "operation": getOrCreateConfiguration(target).setOperation(property(camelContext, org.apache.camel.component.azure.storage.queue.QueueOperationDefinition.class, value)); return true;
        case "popreceipt":
        case "popReceipt": getOrCreateConfiguration(target).setPopReceipt(property(camelContext, java.lang.String.class, value)); return true;
        case "serviceclient":
        case "serviceClient": getOrCreateConfiguration(target).setServiceClient(property(camelContext, com.azure.storage.queue.QueueServiceClient.class, value)); return true;
        case "timetolive":
        case "timeToLive": getOrCreateConfiguration(target).setTimeToLive(property(camelContext, java.time.Duration.class, value)); return true;
        case "timeout": getOrCreateConfiguration(target).setTimeout(property(camelContext, java.time.Duration.class, value)); return true;
        case "visibilitytimeout":
        case "visibilityTimeout": getOrCreateConfiguration(target).setVisibilityTimeout(property(camelContext, java.time.Duration.class, value)); return true;
        default: return false;
        }
    }

    @Override
    public Class<?> getOptionType(String name, boolean ignoreCase) {
        switch (ignoreCase ? name.toLowerCase() : name) {
        case "accesskey":
        case "accessKey": return java.lang.String.class;
        case "autodiscoverclient":
        case "autoDiscoverClient": return boolean.class;
        case "autowiredenabled":
        case "autowiredEnabled": return boolean.class;
        case "bridgeerrorhandler":
        case "bridgeErrorHandler": return boolean.class;
        case "configuration": return org.apache.camel.component.azure.storage.queue.QueueConfiguration.class;
        case "createqueue":
        case "createQueue": return boolean.class;
        case "credentials": return com.azure.storage.common.StorageSharedKeyCredential.class;
        case "lazystartproducer":
        case "lazyStartProducer": return boolean.class;
        case "maxmessages":
        case "maxMessages": return java.lang.Integer.class;
        case "messageid":
        case "messageId": return java.lang.String.class;
        case "operation": return org.apache.camel.component.azure.storage.queue.QueueOperationDefinition.class;
        case "popreceipt":
        case "popReceipt": return java.lang.String.class;
        case "serviceclient":
        case "serviceClient": return com.azure.storage.queue.QueueServiceClient.class;
        case "timetolive":
        case "timeToLive": return java.time.Duration.class;
        case "timeout": return java.time.Duration.class;
        case "visibilitytimeout":
        case "visibilityTimeout": return java.time.Duration.class;
        default: return null;
        }
    }

    @Override
    public Object getOptionValue(Object obj, String name, boolean ignoreCase) {
        QueueComponent target = (QueueComponent) obj;
        switch (ignoreCase ? name.toLowerCase() : name) {
        case "accesskey":
        case "accessKey": return getOrCreateConfiguration(target).getAccessKey();
        case "autodiscoverclient":
        case "autoDiscoverClient": return getOrCreateConfiguration(target).isAutoDiscoverClient();
        case "autowiredenabled":
        case "autowiredEnabled": return target.isAutowiredEnabled();
        case "bridgeerrorhandler":
        case "bridgeErrorHandler": return target.isBridgeErrorHandler();
        case "configuration": return target.getConfiguration();
        case "createqueue":
        case "createQueue": return getOrCreateConfiguration(target).isCreateQueue();
        case "credentials": return getOrCreateConfiguration(target).getCredentials();
        case "lazystartproducer":
        case "lazyStartProducer": return target.isLazyStartProducer();
        case "maxmessages":
        case "maxMessages": return getOrCreateConfiguration(target).getMaxMessages();
        case "messageid":
        case "messageId": return getOrCreateConfiguration(target).getMessageId();
        case "operation": return getOrCreateConfiguration(target).getOperation();
        case "popreceipt":
        case "popReceipt": return getOrCreateConfiguration(target).getPopReceipt();
        case "serviceclient":
        case "serviceClient": return getOrCreateConfiguration(target).getServiceClient();
        case "timetolive":
        case "timeToLive": return getOrCreateConfiguration(target).getTimeToLive();
        case "timeout": return getOrCreateConfiguration(target).getTimeout();
        case "visibilitytimeout":
        case "visibilityTimeout": return getOrCreateConfiguration(target).getVisibilityTimeout();
        default: return null;
        }
    }
}

