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

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.PackageDataFormatMojo")
@SuppressWarnings("unchecked")
public class FlatpackDataFormatConfigurer extends org.apache.camel.support.component.PropertyConfigurerSupport implements GeneratedPropertyConfigurer, ExtendedPropertyConfigurerGetter {

    private static final Map<String, Object> ALL_OPTIONS;
    static {
        Map<String, Object> map = new CaseInsensitiveMap();
        map.put("AllowShortLines", boolean.class);
        map.put("Definition", java.lang.String.class);
        map.put("Delimiter", char.class);
        map.put("Fixed", boolean.class);
        map.put("IgnoreExtraColumns", boolean.class);
        map.put("IgnoreFirstRecord", boolean.class);
        map.put("ParserFactory", net.sf.flatpack.ParserFactory.class);
        map.put("TextQualifier", char.class);
        ALL_OPTIONS = map;
    }

    @Override
    public boolean configure(CamelContext camelContext, Object obj, String name, Object value, boolean ignoreCase) {
        FlatpackDataFormat target = (FlatpackDataFormat) obj;
        switch (ignoreCase ? name.toLowerCase() : name) {
        case "allowshortlines":
        case "allowShortLines": target.setAllowShortLines(property(camelContext, boolean.class, value)); return true;
        case "definition": target.setDefinition(property(camelContext, java.lang.String.class, value)); return true;
        case "delimiter": target.setDelimiter(property(camelContext, char.class, value)); return true;
        case "fixed": target.setFixed(property(camelContext, boolean.class, value)); return true;
        case "ignoreextracolumns":
        case "ignoreExtraColumns": target.setIgnoreExtraColumns(property(camelContext, boolean.class, value)); return true;
        case "ignorefirstrecord":
        case "ignoreFirstRecord": target.setIgnoreFirstRecord(property(camelContext, boolean.class, value)); return true;
        case "parserfactory":
        case "parserFactory": target.setParserFactory(property(camelContext, net.sf.flatpack.ParserFactory.class, value)); return true;
        case "textqualifier":
        case "textQualifier": target.setTextQualifier(property(camelContext, char.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 "allowshortlines":
        case "allowShortLines": return boolean.class;
        case "definition": return java.lang.String.class;
        case "delimiter": return char.class;
        case "fixed": return boolean.class;
        case "ignoreextracolumns":
        case "ignoreExtraColumns": return boolean.class;
        case "ignorefirstrecord":
        case "ignoreFirstRecord": return boolean.class;
        case "parserfactory":
        case "parserFactory": return net.sf.flatpack.ParserFactory.class;
        case "textqualifier":
        case "textQualifier": return char.class;
        default: return null;
        }
    }

    @Override
    public Object getOptionValue(Object obj, String name, boolean ignoreCase) {
        FlatpackDataFormat target = (FlatpackDataFormat) obj;
        switch (ignoreCase ? name.toLowerCase() : name) {
        case "allowshortlines":
        case "allowShortLines": return target.isAllowShortLines();
        case "definition": return target.getDefinition();
        case "delimiter": return target.getDelimiter();
        case "fixed": return target.isFixed();
        case "ignoreextracolumns":
        case "ignoreExtraColumns": return target.isIgnoreExtraColumns();
        case "ignorefirstrecord":
        case "ignoreFirstRecord": return target.isIgnoreFirstRecord();
        case "parserfactory":
        case "parserFactory": return target.getParserFactory();
        case "textqualifier":
        case "textQualifier": return target.getTextQualifier();
        default: return null;
        }
    }
}

