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

import java.util.Map;

import org.apache.camel.CamelContext;
import org.apache.camel.spi.GeneratedPropertyConfigurer;
import org.apache.camel.spi.PropertyConfigurerGetter;
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 YammerComponentConfigurer extends PropertyConfigurerSupport implements GeneratedPropertyConfigurer, PropertyConfigurerGetter {

    private org.apache.camel.component.yammer.YammerConfiguration getOrCreateConfiguration(YammerComponent target) {
        if (target.getConfiguration() == null) {
            target.setConfiguration(new org.apache.camel.component.yammer.YammerConfiguration());
        }
        return target.getConfiguration();
    }

    @Override
    public boolean configure(CamelContext camelContext, Object obj, String name, Object value, boolean ignoreCase) {
        YammerComponent target = (YammerComponent) obj;
        switch (ignoreCase ? name.toLowerCase() : name) {
        case "accesstoken":
        case "accessToken": getOrCreateConfiguration(target).setAccessToken(property(camelContext, java.lang.String.class, value)); return true;
        case "basicpropertybinding":
        case "basicPropertyBinding": target.setBasicPropertyBinding(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.yammer.YammerConfiguration.class, value)); return true;
        case "consumerkey":
        case "consumerKey": getOrCreateConfiguration(target).setConsumerKey(property(camelContext, java.lang.String.class, value)); return true;
        case "consumersecret":
        case "consumerSecret": getOrCreateConfiguration(target).setConsumerSecret(property(camelContext, java.lang.String.class, value)); return true;
        case "delay": getOrCreateConfiguration(target).setDelay(property(camelContext, long.class, value)); return true;
        case "lazystartproducer":
        case "lazyStartProducer": target.setLazyStartProducer(property(camelContext, boolean.class, value)); return true;
        case "limit": getOrCreateConfiguration(target).setLimit(property(camelContext, int.class, value)); return true;
        case "newerthan":
        case "newerThan": getOrCreateConfiguration(target).setNewerThan(property(camelContext, long.class, value)); return true;
        case "olderthan":
        case "olderThan": getOrCreateConfiguration(target).setOlderThan(property(camelContext, long.class, value)); return true;
        case "requestor": getOrCreateConfiguration(target).setRequestor(property(camelContext, org.apache.camel.component.yammer.ApiRequestor.class, value)); return true;
        case "threaded": getOrCreateConfiguration(target).setThreaded(property(camelContext, java.lang.String.class, value)); return true;
        case "usejson":
        case "useJson": getOrCreateConfiguration(target).setUseJson(property(camelContext, boolean.class, value)); return true;
        case "userid":
        case "userId": getOrCreateConfiguration(target).setUserId(property(camelContext, java.lang.String.class, value)); return true;
        default: return false;
        }
    }

    @Override
    public Map<String, Object> getAllOptions(Object target) {
        Map<String, Object> answer = new CaseInsensitiveMap();
        answer.put("accessToken", java.lang.String.class);
        answer.put("basicPropertyBinding", boolean.class);
        answer.put("bridgeErrorHandler", boolean.class);
        answer.put("configuration", org.apache.camel.component.yammer.YammerConfiguration.class);
        answer.put("consumerKey", java.lang.String.class);
        answer.put("consumerSecret", java.lang.String.class);
        answer.put("delay", long.class);
        answer.put("lazyStartProducer", boolean.class);
        answer.put("limit", int.class);
        answer.put("newerThan", long.class);
        answer.put("olderThan", long.class);
        answer.put("requestor", org.apache.camel.component.yammer.ApiRequestor.class);
        answer.put("threaded", java.lang.String.class);
        answer.put("useJson", boolean.class);
        answer.put("userId", java.lang.String.class);
        return answer;
    }

    @Override
    public Object getOptionValue(Object obj, String name, boolean ignoreCase) {
        YammerComponent target = (YammerComponent) obj;
        switch (ignoreCase ? name.toLowerCase() : name) {
        case "accesstoken":
        case "accessToken": return getOrCreateConfiguration(target).getAccessToken();
        case "basicpropertybinding":
        case "basicPropertyBinding": return target.isBasicPropertyBinding();
        case "bridgeerrorhandler":
        case "bridgeErrorHandler": return target.isBridgeErrorHandler();
        case "configuration": return target.getConfiguration();
        case "consumerkey":
        case "consumerKey": return getOrCreateConfiguration(target).getConsumerKey();
        case "consumersecret":
        case "consumerSecret": return getOrCreateConfiguration(target).getConsumerSecret();
        case "delay": return getOrCreateConfiguration(target).getDelay();
        case "lazystartproducer":
        case "lazyStartProducer": return target.isLazyStartProducer();
        case "limit": return getOrCreateConfiguration(target).getLimit();
        case "newerthan":
        case "newerThan": return getOrCreateConfiguration(target).getNewerThan();
        case "olderthan":
        case "olderThan": return getOrCreateConfiguration(target).getOlderThan();
        case "requestor": return getOrCreateConfiguration(target).getRequestor();
        case "threaded": return getOrCreateConfiguration(target).getThreaded();
        case "usejson":
        case "useJson": return getOrCreateConfiguration(target).isUseJson();
        case "userid":
        case "userId": return getOrCreateConfiguration(target).getUserId();
        default: return null;
        }
    }
}

