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

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 BoxComponentConfigurer extends PropertyConfigurerSupport implements GeneratedPropertyConfigurer, ExtendedPropertyConfigurerGetter {

    private static final Map<String, Object> ALL_OPTIONS;
    static {
        Map<String, Object> map = new CaseInsensitiveMap();
        map.put("ClientId", java.lang.String.class);
        map.put("Configuration", org.apache.camel.component.box.BoxConfiguration.class);
        map.put("EnterpriseId", java.lang.String.class);
        map.put("UserId", java.lang.String.class);
        map.put("BridgeErrorHandler", boolean.class);
        map.put("LazyStartProducer", boolean.class);
        map.put("AutowiredEnabled", boolean.class);
        map.put("HttpParams", java.util.Map.class);
        map.put("AuthenticationType", java.lang.String.class);
        map.put("AccessTokenCache", com.box.sdk.IAccessTokenCache.class);
        map.put("ClientSecret", java.lang.String.class);
        map.put("EncryptionAlgorithm", com.box.sdk.EncryptionAlgorithm.class);
        map.put("MaxCacheEntries", int.class);
        map.put("PrivateKeyFile", java.lang.String.class);
        map.put("PrivateKeyPassword", java.lang.String.class);
        map.put("PublicKeyId", java.lang.String.class);
        map.put("SslContextParameters", org.apache.camel.support.jsse.SSLContextParameters.class);
        map.put("UserName", java.lang.String.class);
        map.put("UserPassword", java.lang.String.class);
        ALL_OPTIONS = map;
    }

    private org.apache.camel.component.box.BoxConfiguration getOrCreateConfiguration(BoxComponent target) {
        if (target.getConfiguration() == null) {
            target.setConfiguration(new org.apache.camel.component.box.BoxConfiguration());
        }
        return target.getConfiguration();
    }

    @Override
    public boolean configure(CamelContext camelContext, Object obj, String name, Object value, boolean ignoreCase) {
        BoxComponent target = (BoxComponent) obj;
        switch (ignoreCase ? name.toLowerCase() : name) {
        case "accesstokencache":
        case "accessTokenCache": getOrCreateConfiguration(target).setAccessTokenCache(property(camelContext, com.box.sdk.IAccessTokenCache.class, value)); return true;
        case "authenticationtype":
        case "authenticationType": getOrCreateConfiguration(target).setAuthenticationType(property(camelContext, java.lang.String.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 "clientid":
        case "clientId": getOrCreateConfiguration(target).setClientId(property(camelContext, java.lang.String.class, value)); return true;
        case "clientsecret":
        case "clientSecret": getOrCreateConfiguration(target).setClientSecret(property(camelContext, java.lang.String.class, value)); return true;
        case "configuration": target.setConfiguration(property(camelContext, org.apache.camel.component.box.BoxConfiguration.class, value)); return true;
        case "encryptionalgorithm":
        case "encryptionAlgorithm": getOrCreateConfiguration(target).setEncryptionAlgorithm(property(camelContext, com.box.sdk.EncryptionAlgorithm.class, value)); return true;
        case "enterpriseid":
        case "enterpriseId": getOrCreateConfiguration(target).setEnterpriseId(property(camelContext, java.lang.String.class, value)); return true;
        case "httpparams":
        case "httpParams": getOrCreateConfiguration(target).setHttpParams(property(camelContext, java.util.Map.class, value)); return true;
        case "lazystartproducer":
        case "lazyStartProducer": target.setLazyStartProducer(property(camelContext, boolean.class, value)); return true;
        case "maxcacheentries":
        case "maxCacheEntries": getOrCreateConfiguration(target).setMaxCacheEntries(property(camelContext, int.class, value)); return true;
        case "privatekeyfile":
        case "privateKeyFile": getOrCreateConfiguration(target).setPrivateKeyFile(property(camelContext, java.lang.String.class, value)); return true;
        case "privatekeypassword":
        case "privateKeyPassword": getOrCreateConfiguration(target).setPrivateKeyPassword(property(camelContext, java.lang.String.class, value)); return true;
        case "publickeyid":
        case "publicKeyId": getOrCreateConfiguration(target).setPublicKeyId(property(camelContext, java.lang.String.class, value)); return true;
        case "sslcontextparameters":
        case "sslContextParameters": getOrCreateConfiguration(target).setSslContextParameters(property(camelContext, org.apache.camel.support.jsse.SSLContextParameters.class, value)); return true;
        case "userid":
        case "userId": getOrCreateConfiguration(target).setUserId(property(camelContext, java.lang.String.class, value)); return true;
        case "username":
        case "userName": getOrCreateConfiguration(target).setUserName(property(camelContext, java.lang.String.class, value)); return true;
        case "userpassword":
        case "userPassword": getOrCreateConfiguration(target).setUserPassword(property(camelContext, java.lang.String.class, value)); return true;
        default: return false;
        }
    }

    @Override
    public Map<String, Object> getAllOptions(Object target) {
        return ALL_OPTIONS;
    }

    @Override
    public Class<?> getOptionType(String name, boolean ignoreCase) {
        switch (ignoreCase ? name.toLowerCase() : name) {
        case "accesstokencache":
        case "accessTokenCache": return com.box.sdk.IAccessTokenCache.class;
        case "authenticationtype":
        case "authenticationType": return java.lang.String.class;
        case "autowiredenabled":
        case "autowiredEnabled": return boolean.class;
        case "bridgeerrorhandler":
        case "bridgeErrorHandler": return boolean.class;
        case "clientid":
        case "clientId": return java.lang.String.class;
        case "clientsecret":
        case "clientSecret": return java.lang.String.class;
        case "configuration": return org.apache.camel.component.box.BoxConfiguration.class;
        case "encryptionalgorithm":
        case "encryptionAlgorithm": return com.box.sdk.EncryptionAlgorithm.class;
        case "enterpriseid":
        case "enterpriseId": return java.lang.String.class;
        case "httpparams":
        case "httpParams": return java.util.Map.class;
        case "lazystartproducer":
        case "lazyStartProducer": return boolean.class;
        case "maxcacheentries":
        case "maxCacheEntries": return int.class;
        case "privatekeyfile":
        case "privateKeyFile": return java.lang.String.class;
        case "privatekeypassword":
        case "privateKeyPassword": return java.lang.String.class;
        case "publickeyid":
        case "publicKeyId": return java.lang.String.class;
        case "sslcontextparameters":
        case "sslContextParameters": return org.apache.camel.support.jsse.SSLContextParameters.class;
        case "userid":
        case "userId": return java.lang.String.class;
        case "username":
        case "userName": return java.lang.String.class;
        case "userpassword":
        case "userPassword": return java.lang.String.class;
        default: return null;
        }
    }

    @Override
    public Object getOptionValue(Object obj, String name, boolean ignoreCase) {
        BoxComponent target = (BoxComponent) obj;
        switch (ignoreCase ? name.toLowerCase() : name) {
        case "accesstokencache":
        case "accessTokenCache": return getOrCreateConfiguration(target).getAccessTokenCache();
        case "authenticationtype":
        case "authenticationType": return getOrCreateConfiguration(target).getAuthenticationType();
        case "autowiredenabled":
        case "autowiredEnabled": return target.isAutowiredEnabled();
        case "bridgeerrorhandler":
        case "bridgeErrorHandler": return target.isBridgeErrorHandler();
        case "clientid":
        case "clientId": return getOrCreateConfiguration(target).getClientId();
        case "clientsecret":
        case "clientSecret": return getOrCreateConfiguration(target).getClientSecret();
        case "configuration": return target.getConfiguration();
        case "encryptionalgorithm":
        case "encryptionAlgorithm": return getOrCreateConfiguration(target).getEncryptionAlgorithm();
        case "enterpriseid":
        case "enterpriseId": return getOrCreateConfiguration(target).getEnterpriseId();
        case "httpparams":
        case "httpParams": return getOrCreateConfiguration(target).getHttpParams();
        case "lazystartproducer":
        case "lazyStartProducer": return target.isLazyStartProducer();
        case "maxcacheentries":
        case "maxCacheEntries": return getOrCreateConfiguration(target).getMaxCacheEntries();
        case "privatekeyfile":
        case "privateKeyFile": return getOrCreateConfiguration(target).getPrivateKeyFile();
        case "privatekeypassword":
        case "privateKeyPassword": return getOrCreateConfiguration(target).getPrivateKeyPassword();
        case "publickeyid":
        case "publicKeyId": return getOrCreateConfiguration(target).getPublicKeyId();
        case "sslcontextparameters":
        case "sslContextParameters": return getOrCreateConfiguration(target).getSslContextParameters();
        case "userid":
        case "userId": return getOrCreateConfiguration(target).getUserId();
        case "username":
        case "userName": return getOrCreateConfiguration(target).getUserName();
        case "userpassword":
        case "userPassword": return getOrCreateConfiguration(target).getUserPassword();
        default: return null;
        }
    }

    @Override
    public Object getCollectionValueType(Object target, String name, boolean ignoreCase) {
        switch (ignoreCase ? name.toLowerCase() : name) {
        case "httpparams":
        case "httpParams": return java.lang.Object.class;
        default: return null;
        }
    }
}

