All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.apache.camel.component.ganglia.GangliaComponentConfigurer Maven / Gradle / Ivy

There is a newer version: 3.16.0
Show newest version
/* Generated by camel build tools - do NOT edit this file! */
package org.apache.camel.component.ganglia;

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

    private org.apache.camel.component.ganglia.GangliaConfiguration getOrCreateConfiguration(GangliaComponent target) {
        if (target.getConfiguration() == null) {
            target.setConfiguration(new org.apache.camel.component.ganglia.GangliaConfiguration());
        }
        return target.getConfiguration();
    }

    @Override
    public boolean configure(CamelContext camelContext, Object obj, String name, Object value, boolean ignoreCase) {
        GangliaComponent target = (GangliaComponent) obj;
        switch (ignoreCase ? name.toLowerCase() : name) {
        case "autowiredenabled":
        case "autowiredEnabled": target.setAutowiredEnabled(property(camelContext, boolean.class, value)); return true;
        case "configuration": target.setConfiguration(property(camelContext, org.apache.camel.component.ganglia.GangliaConfiguration.class, value)); return true;
        case "dmax": getOrCreateConfiguration(target).setDmax(property(camelContext, int.class, value)); return true;
        case "groupname":
        case "groupName": getOrCreateConfiguration(target).setGroupName(property(camelContext, java.lang.String.class, value)); return true;
        case "lazystartproducer":
        case "lazyStartProducer": target.setLazyStartProducer(property(camelContext, boolean.class, value)); return true;
        case "metricname":
        case "metricName": getOrCreateConfiguration(target).setMetricName(property(camelContext, java.lang.String.class, value)); return true;
        case "mode": getOrCreateConfiguration(target).setMode(property(camelContext, info.ganglia.gmetric4j.gmetric.GMetric.UDPAddressingMode.class, value)); return true;
        case "prefix": getOrCreateConfiguration(target).setPrefix(property(camelContext, java.lang.String.class, value)); return true;
        case "slope": getOrCreateConfiguration(target).setSlope(property(camelContext, info.ganglia.gmetric4j.gmetric.GMetricSlope.class, value)); return true;
        case "spoofhostname":
        case "spoofHostname": getOrCreateConfiguration(target).setSpoofHostname(property(camelContext, java.lang.String.class, value)); return true;
        case "tmax": getOrCreateConfiguration(target).setTmax(property(camelContext, int.class, value)); return true;
        case "ttl": getOrCreateConfiguration(target).setTtl(property(camelContext, int.class, value)); return true;
        case "type": getOrCreateConfiguration(target).setType(property(camelContext, info.ganglia.gmetric4j.gmetric.GMetricType.class, value)); return true;
        case "units": getOrCreateConfiguration(target).setUnits(property(camelContext, java.lang.String.class, value)); return true;
        case "wireformat31x":
        case "wireFormat31x": getOrCreateConfiguration(target).setWireFormat31x(property(camelContext, boolean.class, value)); return true;
        default: return false;
        }
    }

    @Override
    public Class getOptionType(String name, boolean ignoreCase) {
        switch (ignoreCase ? name.toLowerCase() : name) {
        case "autowiredenabled":
        case "autowiredEnabled": return boolean.class;
        case "configuration": return org.apache.camel.component.ganglia.GangliaConfiguration.class;
        case "dmax": return int.class;
        case "groupname":
        case "groupName": return java.lang.String.class;
        case "lazystartproducer":
        case "lazyStartProducer": return boolean.class;
        case "metricname":
        case "metricName": return java.lang.String.class;
        case "mode": return info.ganglia.gmetric4j.gmetric.GMetric.UDPAddressingMode.class;
        case "prefix": return java.lang.String.class;
        case "slope": return info.ganglia.gmetric4j.gmetric.GMetricSlope.class;
        case "spoofhostname":
        case "spoofHostname": return java.lang.String.class;
        case "tmax": return int.class;
        case "ttl": return int.class;
        case "type": return info.ganglia.gmetric4j.gmetric.GMetricType.class;
        case "units": return java.lang.String.class;
        case "wireformat31x":
        case "wireFormat31x": return boolean.class;
        default: return null;
        }
    }

    @Override
    public Object getOptionValue(Object obj, String name, boolean ignoreCase) {
        GangliaComponent target = (GangliaComponent) obj;
        switch (ignoreCase ? name.toLowerCase() : name) {
        case "autowiredenabled":
        case "autowiredEnabled": return target.isAutowiredEnabled();
        case "configuration": return target.getConfiguration();
        case "dmax": return getOrCreateConfiguration(target).getDmax();
        case "groupname":
        case "groupName": return getOrCreateConfiguration(target).getGroupName();
        case "lazystartproducer":
        case "lazyStartProducer": return target.isLazyStartProducer();
        case "metricname":
        case "metricName": return getOrCreateConfiguration(target).getMetricName();
        case "mode": return getOrCreateConfiguration(target).getMode();
        case "prefix": return getOrCreateConfiguration(target).getPrefix();
        case "slope": return getOrCreateConfiguration(target).getSlope();
        case "spoofhostname":
        case "spoofHostname": return getOrCreateConfiguration(target).getSpoofHostname();
        case "tmax": return getOrCreateConfiguration(target).getTmax();
        case "ttl": return getOrCreateConfiguration(target).getTtl();
        case "type": return getOrCreateConfiguration(target).getType();
        case "units": return getOrCreateConfiguration(target).getUnits();
        case "wireformat31x":
        case "wireFormat31x": return getOrCreateConfiguration(target).isWireFormat31x();
        default: return null;
        }
    }
}





© 2015 - 2024 Weber Informatics LLC | Privacy Policy