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

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

    private org.apache.camel.component.infinispan.embedded.InfinispanEmbeddedConfiguration getOrCreateConfiguration(InfinispanEmbeddedComponent target) {
        if (target.getConfiguration() == null) {
            target.setConfiguration(new org.apache.camel.component.infinispan.embedded.InfinispanEmbeddedConfiguration());
        }
        return target.getConfiguration();
    }

    @Override
    public boolean configure(CamelContext camelContext, Object obj, String name, Object value, boolean ignoreCase) {
        InfinispanEmbeddedComponent target = (InfinispanEmbeddedComponent) 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 "cachecontainer":
        case "cacheContainer": getOrCreateConfiguration(target).setCacheContainer(property(camelContext, org.infinispan.manager.EmbeddedCacheManager.class, value)); return true;
        case "cachecontainerconfiguration":
        case "cacheContainerConfiguration": getOrCreateConfiguration(target).setCacheContainerConfiguration(property(camelContext, org.infinispan.configuration.cache.Configuration.class, value)); return true;
        case "clusteredlistener":
        case "clusteredListener": getOrCreateConfiguration(target).setClusteredListener(property(camelContext, boolean.class, value)); return true;
        case "configuration": target.setConfiguration(property(camelContext, org.apache.camel.component.infinispan.embedded.InfinispanEmbeddedConfiguration.class, value)); return true;
        case "configurationuri":
        case "configurationUri": getOrCreateConfiguration(target).setConfigurationUri(property(camelContext, java.lang.String.class, value)); return true;
        case "customlistener":
        case "customListener": getOrCreateConfiguration(target).setCustomListener(property(camelContext, org.apache.camel.component.infinispan.embedded.InfinispanEmbeddedCustomListener.class, value)); return true;
        case "defaultvalue":
        case "defaultValue": getOrCreateConfiguration(target).setDefaultValue(property(camelContext, java.lang.Object.class, value)); return true;
        case "eventtypes":
        case "eventTypes": getOrCreateConfiguration(target).setEventTypes(property(camelContext, java.lang.String.class, value)); return true;
        case "flags": getOrCreateConfiguration(target).setFlags(property(camelContext, java.lang.String.class, value)); return true;
        case "key": getOrCreateConfiguration(target).setKey(property(camelContext, java.lang.Object.class, value)); return true;
        case "lazystartproducer":
        case "lazyStartProducer": target.setLazyStartProducer(property(camelContext, boolean.class, value)); return true;
        case "oldvalue":
        case "oldValue": getOrCreateConfiguration(target).setOldValue(property(camelContext, java.lang.Object.class, value)); return true;
        case "operation": getOrCreateConfiguration(target).setOperation(property(camelContext, org.apache.camel.component.infinispan.InfinispanOperation.class, value)); return true;
        case "querybuilder":
        case "queryBuilder": getOrCreateConfiguration(target).setQueryBuilder(property(camelContext, org.apache.camel.component.infinispan.InfinispanQueryBuilder.class, value)); return true;
        case "remappingfunction":
        case "remappingFunction": getOrCreateConfiguration(target).setRemappingFunction(property(camelContext, java.util.function.BiFunction.class, value)); return true;
        case "resultheader":
        case "resultHeader": getOrCreateConfiguration(target).setResultHeader(property(camelContext, java.lang.String.class, value)); return true;
        case "sync": getOrCreateConfiguration(target).setSync(property(camelContext, boolean.class, value)); return true;
        case "value": getOrCreateConfiguration(target).setValue(property(camelContext, java.lang.Object.class, value)); return true;
        default: return false;
        }
    }

    @Override
    public String[] getAutowiredNames() {
        return new String[]{"cacheContainer", "cacheContainerConfiguration"};
    }

    @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 "cachecontainer":
        case "cacheContainer": return org.infinispan.manager.EmbeddedCacheManager.class;
        case "cachecontainerconfiguration":
        case "cacheContainerConfiguration": return org.infinispan.configuration.cache.Configuration.class;
        case "clusteredlistener":
        case "clusteredListener": return boolean.class;
        case "configuration": return org.apache.camel.component.infinispan.embedded.InfinispanEmbeddedConfiguration.class;
        case "configurationuri":
        case "configurationUri": return java.lang.String.class;
        case "customlistener":
        case "customListener": return org.apache.camel.component.infinispan.embedded.InfinispanEmbeddedCustomListener.class;
        case "defaultvalue":
        case "defaultValue": return java.lang.Object.class;
        case "eventtypes":
        case "eventTypes": return java.lang.String.class;
        case "flags": return java.lang.String.class;
        case "key": return java.lang.Object.class;
        case "lazystartproducer":
        case "lazyStartProducer": return boolean.class;
        case "oldvalue":
        case "oldValue": return java.lang.Object.class;
        case "operation": return org.apache.camel.component.infinispan.InfinispanOperation.class;
        case "querybuilder":
        case "queryBuilder": return org.apache.camel.component.infinispan.InfinispanQueryBuilder.class;
        case "remappingfunction":
        case "remappingFunction": return java.util.function.BiFunction.class;
        case "resultheader":
        case "resultHeader": return java.lang.String.class;
        case "sync": return boolean.class;
        case "value": return java.lang.Object.class;
        default: return null;
        }
    }

    @Override
    public Object getOptionValue(Object obj, String name, boolean ignoreCase) {
        InfinispanEmbeddedComponent target = (InfinispanEmbeddedComponent) obj;
        switch (ignoreCase ? name.toLowerCase() : name) {
        case "autowiredenabled":
        case "autowiredEnabled": return target.isAutowiredEnabled();
        case "bridgeerrorhandler":
        case "bridgeErrorHandler": return target.isBridgeErrorHandler();
        case "cachecontainer":
        case "cacheContainer": return getOrCreateConfiguration(target).getCacheContainer();
        case "cachecontainerconfiguration":
        case "cacheContainerConfiguration": return getOrCreateConfiguration(target).getCacheContainerConfiguration();
        case "clusteredlistener":
        case "clusteredListener": return getOrCreateConfiguration(target).isClusteredListener();
        case "configuration": return target.getConfiguration();
        case "configurationuri":
        case "configurationUri": return getOrCreateConfiguration(target).getConfigurationUri();
        case "customlistener":
        case "customListener": return getOrCreateConfiguration(target).getCustomListener();
        case "defaultvalue":
        case "defaultValue": return getOrCreateConfiguration(target).getDefaultValue();
        case "eventtypes":
        case "eventTypes": return getOrCreateConfiguration(target).getEventTypes();
        case "flags": return getOrCreateConfiguration(target).getFlags();
        case "key": return getOrCreateConfiguration(target).getKey();
        case "lazystartproducer":
        case "lazyStartProducer": return target.isLazyStartProducer();
        case "oldvalue":
        case "oldValue": return getOrCreateConfiguration(target).getOldValue();
        case "operation": return getOrCreateConfiguration(target).getOperation();
        case "querybuilder":
        case "queryBuilder": return getOrCreateConfiguration(target).getQueryBuilder();
        case "remappingfunction":
        case "remappingFunction": return getOrCreateConfiguration(target).getRemappingFunction();
        case "resultheader":
        case "resultHeader": return getOrCreateConfiguration(target).getResultHeader();
        case "sync": return getOrCreateConfiguration(target).isSync();
        case "value": return getOrCreateConfiguration(target).getValue();
        default: return null;
        }
    }
}

