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

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

    @Override
    public boolean configure(CamelContext camelContext, Object obj, String name, Object value, boolean ignoreCase) {
        BeanValidatorComponent target = (BeanValidatorComponent) obj;
        switch (ignoreCase ? name.toLowerCase() : name) {
        case "autowiredenabled":
        case "autowiredEnabled": target.setAutowiredEnabled(property(camelContext, boolean.class, value)); return true;
        case "constraintvalidatorfactory":
        case "constraintValidatorFactory": target.setConstraintValidatorFactory(property(camelContext, jakarta.validation.ConstraintValidatorFactory.class, value)); return true;
        case "ignorexmlconfiguration":
        case "ignoreXmlConfiguration": target.setIgnoreXmlConfiguration(property(camelContext, boolean.class, value)); return true;
        case "lazystartproducer":
        case "lazyStartProducer": target.setLazyStartProducer(property(camelContext, boolean.class, value)); return true;
        case "messageinterpolator":
        case "messageInterpolator": target.setMessageInterpolator(property(camelContext, jakarta.validation.MessageInterpolator.class, value)); return true;
        case "traversableresolver":
        case "traversableResolver": target.setTraversableResolver(property(camelContext, jakarta.validation.TraversableResolver.class, value)); return true;
        case "validationproviderresolver":
        case "validationProviderResolver": target.setValidationProviderResolver(property(camelContext, jakarta.validation.ValidationProviderResolver.class, value)); return true;
        case "validatorfactory":
        case "validatorFactory": target.setValidatorFactory(property(camelContext, jakarta.validation.ValidatorFactory.class, value)); return true;
        default: return false;
        }
    }

    @Override
    public String[] getAutowiredNames() {
        return new String[]{"validatorFactory"};
    }

    @Override
    public Class<?> getOptionType(String name, boolean ignoreCase) {
        switch (ignoreCase ? name.toLowerCase() : name) {
        case "autowiredenabled":
        case "autowiredEnabled": return boolean.class;
        case "constraintvalidatorfactory":
        case "constraintValidatorFactory": return jakarta.validation.ConstraintValidatorFactory.class;
        case "ignorexmlconfiguration":
        case "ignoreXmlConfiguration": return boolean.class;
        case "lazystartproducer":
        case "lazyStartProducer": return boolean.class;
        case "messageinterpolator":
        case "messageInterpolator": return jakarta.validation.MessageInterpolator.class;
        case "traversableresolver":
        case "traversableResolver": return jakarta.validation.TraversableResolver.class;
        case "validationproviderresolver":
        case "validationProviderResolver": return jakarta.validation.ValidationProviderResolver.class;
        case "validatorfactory":
        case "validatorFactory": return jakarta.validation.ValidatorFactory.class;
        default: return null;
        }
    }

    @Override
    public Object getOptionValue(Object obj, String name, boolean ignoreCase) {
        BeanValidatorComponent target = (BeanValidatorComponent) obj;
        switch (ignoreCase ? name.toLowerCase() : name) {
        case "autowiredenabled":
        case "autowiredEnabled": return target.isAutowiredEnabled();
        case "constraintvalidatorfactory":
        case "constraintValidatorFactory": return target.getConstraintValidatorFactory();
        case "ignorexmlconfiguration":
        case "ignoreXmlConfiguration": return target.isIgnoreXmlConfiguration();
        case "lazystartproducer":
        case "lazyStartProducer": return target.isLazyStartProducer();
        case "messageinterpolator":
        case "messageInterpolator": return target.getMessageInterpolator();
        case "traversableresolver":
        case "traversableResolver": return target.getTraversableResolver();
        case "validationproviderresolver":
        case "validationProviderResolver": return target.getValidationProviderResolver();
        case "validatorfactory":
        case "validatorFactory": return target.getValidatorFactory();
        default: return null;
        }
    }
}

