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

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 CsvDataFormatConfigurer 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("AllowMissingColumnNames", java.lang.Boolean.class);
        map.put("CaptureHeaderRecord", boolean.class);
        map.put("CommentMarker", java.lang.Character.class);
        map.put("CommentMarkerDisabled", boolean.class);
        map.put("Delimiter", java.lang.Character.class);
        map.put("Escape", java.lang.Character.class);
        map.put("EscapeDisabled", boolean.class);
        map.put("Format", java.lang.String.class);
        map.put("Header", java.lang.String.class);
        map.put("HeaderDisabled", boolean.class);
        map.put("IgnoreEmptyLines", java.lang.Boolean.class);
        map.put("IgnoreHeaderCase", java.lang.Boolean.class);
        map.put("IgnoreSurroundingSpaces", java.lang.Boolean.class);
        map.put("LazyLoad", boolean.class);
        map.put("NullString", java.lang.String.class);
        map.put("NullStringDisabled", boolean.class);
        map.put("Quote", java.lang.Character.class);
        map.put("QuoteDisabled", boolean.class);
        map.put("QuoteMode", org.apache.commons.csv.QuoteMode.class);
        map.put("RecordSeparator", java.lang.String.class);
        map.put("RecordSeparatorDisabled", boolean.class);
        map.put("SkipHeaderRecord", java.lang.Boolean.class);
        map.put("TrailingDelimiter", java.lang.Boolean.class);
        map.put("Trim", java.lang.Boolean.class);
        map.put("UseMaps", boolean.class);
        map.put("UseOrderedMaps", boolean.class);
        ALL_OPTIONS = map;
    }

    @Override
    public boolean configure(CamelContext camelContext, Object obj, String name, Object value, boolean ignoreCase) {
        CsvDataFormat target = (CsvDataFormat) obj;
        switch (ignoreCase ? name.toLowerCase() : name) {
        case "allowmissingcolumnnames":
        case "allowMissingColumnNames": target.setAllowMissingColumnNames(property(camelContext, java.lang.Boolean.class, value)); return true;
        case "captureheaderrecord":
        case "captureHeaderRecord": target.setCaptureHeaderRecord(property(camelContext, boolean.class, value)); return true;
        case "commentmarker":
        case "commentMarker": target.setCommentMarker(property(camelContext, java.lang.Character.class, value)); return true;
        case "commentmarkerdisabled":
        case "commentMarkerDisabled": target.setCommentMarkerDisabled(property(camelContext, boolean.class, value)); return true;
        case "delimiter": target.setDelimiter(property(camelContext, java.lang.Character.class, value)); return true;
        case "escape": target.setEscape(property(camelContext, java.lang.Character.class, value)); return true;
        case "escapedisabled":
        case "escapeDisabled": target.setEscapeDisabled(property(camelContext, boolean.class, value)); return true;
        case "format": target.setFormat(property(camelContext, java.lang.String.class, value)); return true;
        case "header": target.setHeader(property(camelContext, java.lang.String.class, value)); return true;
        case "headerdisabled":
        case "headerDisabled": target.setHeaderDisabled(property(camelContext, boolean.class, value)); return true;
        case "ignoreemptylines":
        case "ignoreEmptyLines": target.setIgnoreEmptyLines(property(camelContext, java.lang.Boolean.class, value)); return true;
        case "ignoreheadercase":
        case "ignoreHeaderCase": target.setIgnoreHeaderCase(property(camelContext, java.lang.Boolean.class, value)); return true;
        case "ignoresurroundingspaces":
        case "ignoreSurroundingSpaces": target.setIgnoreSurroundingSpaces(property(camelContext, java.lang.Boolean.class, value)); return true;
        case "lazyload":
        case "lazyLoad": target.setLazyLoad(property(camelContext, boolean.class, value)); return true;
        case "nullstring":
        case "nullString": target.setNullString(property(camelContext, java.lang.String.class, value)); return true;
        case "nullstringdisabled":
        case "nullStringDisabled": target.setNullStringDisabled(property(camelContext, boolean.class, value)); return true;
        case "quote": target.setQuote(property(camelContext, java.lang.Character.class, value)); return true;
        case "quotedisabled":
        case "quoteDisabled": target.setQuoteDisabled(property(camelContext, boolean.class, value)); return true;
        case "quotemode":
        case "quoteMode": target.setQuoteMode(property(camelContext, org.apache.commons.csv.QuoteMode.class, value)); return true;
        case "recordseparator":
        case "recordSeparator": target.setRecordSeparator(property(camelContext, java.lang.String.class, value)); return true;
        case "recordseparatordisabled":
        case "recordSeparatorDisabled": target.setRecordSeparatorDisabled(property(camelContext, boolean.class, value)); return true;
        case "skipheaderrecord":
        case "skipHeaderRecord": target.setSkipHeaderRecord(property(camelContext, java.lang.Boolean.class, value)); return true;
        case "trailingdelimiter":
        case "trailingDelimiter": target.setTrailingDelimiter(property(camelContext, java.lang.Boolean.class, value)); return true;
        case "trim": target.setTrim(property(camelContext, java.lang.Boolean.class, value)); return true;
        case "usemaps":
        case "useMaps": target.setUseMaps(property(camelContext, boolean.class, value)); return true;
        case "useorderedmaps":
        case "useOrderedMaps": target.setUseOrderedMaps(property(camelContext, boolean.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 "allowmissingcolumnnames":
        case "allowMissingColumnNames": return java.lang.Boolean.class;
        case "captureheaderrecord":
        case "captureHeaderRecord": return boolean.class;
        case "commentmarker":
        case "commentMarker": return java.lang.Character.class;
        case "commentmarkerdisabled":
        case "commentMarkerDisabled": return boolean.class;
        case "delimiter": return java.lang.Character.class;
        case "escape": return java.lang.Character.class;
        case "escapedisabled":
        case "escapeDisabled": return boolean.class;
        case "format": return java.lang.String.class;
        case "header": return java.lang.String.class;
        case "headerdisabled":
        case "headerDisabled": return boolean.class;
        case "ignoreemptylines":
        case "ignoreEmptyLines": return java.lang.Boolean.class;
        case "ignoreheadercase":
        case "ignoreHeaderCase": return java.lang.Boolean.class;
        case "ignoresurroundingspaces":
        case "ignoreSurroundingSpaces": return java.lang.Boolean.class;
        case "lazyload":
        case "lazyLoad": return boolean.class;
        case "nullstring":
        case "nullString": return java.lang.String.class;
        case "nullstringdisabled":
        case "nullStringDisabled": return boolean.class;
        case "quote": return java.lang.Character.class;
        case "quotedisabled":
        case "quoteDisabled": return boolean.class;
        case "quotemode":
        case "quoteMode": return org.apache.commons.csv.QuoteMode.class;
        case "recordseparator":
        case "recordSeparator": return java.lang.String.class;
        case "recordseparatordisabled":
        case "recordSeparatorDisabled": return boolean.class;
        case "skipheaderrecord":
        case "skipHeaderRecord": return java.lang.Boolean.class;
        case "trailingdelimiter":
        case "trailingDelimiter": return java.lang.Boolean.class;
        case "trim": return java.lang.Boolean.class;
        case "usemaps":
        case "useMaps": return boolean.class;
        case "useorderedmaps":
        case "useOrderedMaps": return boolean.class;
        default: return null;
        }
    }

    @Override
    public Object getOptionValue(Object obj, String name, boolean ignoreCase) {
        CsvDataFormat target = (CsvDataFormat) obj;
        switch (ignoreCase ? name.toLowerCase() : name) {
        case "allowmissingcolumnnames":
        case "allowMissingColumnNames": return target.getAllowMissingColumnNames();
        case "captureheaderrecord":
        case "captureHeaderRecord": return target.isCaptureHeaderRecord();
        case "commentmarker":
        case "commentMarker": return target.getCommentMarker();
        case "commentmarkerdisabled":
        case "commentMarkerDisabled": return target.isCommentMarkerDisabled();
        case "delimiter": return target.getDelimiter();
        case "escape": return target.getEscape();
        case "escapedisabled":
        case "escapeDisabled": return target.isEscapeDisabled();
        case "format": return target.getFormat();
        case "header": return target.getHeader();
        case "headerdisabled":
        case "headerDisabled": return target.isHeaderDisabled();
        case "ignoreemptylines":
        case "ignoreEmptyLines": return target.getIgnoreEmptyLines();
        case "ignoreheadercase":
        case "ignoreHeaderCase": return target.getIgnoreHeaderCase();
        case "ignoresurroundingspaces":
        case "ignoreSurroundingSpaces": return target.getIgnoreSurroundingSpaces();
        case "lazyload":
        case "lazyLoad": return target.isLazyLoad();
        case "nullstring":
        case "nullString": return target.getNullString();
        case "nullstringdisabled":
        case "nullStringDisabled": return target.isNullStringDisabled();
        case "quote": return target.getQuote();
        case "quotedisabled":
        case "quoteDisabled": return target.isQuoteDisabled();
        case "quotemode":
        case "quoteMode": return target.getQuoteMode();
        case "recordseparator":
        case "recordSeparator": return target.getRecordSeparator();
        case "recordseparatordisabled":
        case "recordSeparatorDisabled": return target.isRecordSeparatorDisabled();
        case "skipheaderrecord":
        case "skipHeaderRecord": return target.getSkipHeaderRecord();
        case "trailingdelimiter":
        case "trailingDelimiter": return target.getTrailingDelimiter();
        case "trim": return target.getTrim();
        case "usemaps":
        case "useMaps": return target.isUseMaps();
        case "useorderedmaps":
        case "useOrderedMaps": return target.isUseOrderedMaps();
        default: return null;
        }
    }
}

