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

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 CryptoDataFormatConfigurer 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("Algorithm", java.lang.String.class);
        map.put("AlgorithmParameterSpec", java.security.spec.AlgorithmParameterSpec.class);
        map.put("BufferSize", int.class);
        map.put("CryptoProvider", java.lang.String.class);
        map.put("InitVector", byte[].class);
        map.put("Inline", boolean.class);
        map.put("Key", java.security.Key.class);
        map.put("MacAlgorithm", java.lang.String.class);
        map.put("ShouldAppendHMAC", boolean.class);
        ALL_OPTIONS = map;
    }

    @Override
    public boolean configure(CamelContext camelContext, Object obj, String name, Object value, boolean ignoreCase) {
        CryptoDataFormat target = (CryptoDataFormat) obj;
        switch (ignoreCase ? name.toLowerCase() : name) {
        case "algorithm": target.setAlgorithm(property(camelContext, java.lang.String.class, value)); return true;
        case "algorithmparameterspec":
        case "algorithmParameterSpec": target.setAlgorithmParameterSpec(property(camelContext, java.security.spec.AlgorithmParameterSpec.class, value)); return true;
        case "buffersize":
        case "bufferSize": target.setBufferSize(property(camelContext, int.class, value)); return true;
        case "cryptoprovider":
        case "cryptoProvider": target.setCryptoProvider(property(camelContext, java.lang.String.class, value)); return true;
        case "initvector":
        case "initVector": target.setInitVector(property(camelContext, byte[].class, value)); return true;
        case "inline": target.setInline(property(camelContext, boolean.class, value)); return true;
        case "key": target.setKey(property(camelContext, java.security.Key.class, value)); return true;
        case "macalgorithm":
        case "macAlgorithm": target.setMacAlgorithm(property(camelContext, java.lang.String.class, value)); return true;
        case "shouldappendhmac":
        case "shouldAppendHMAC": target.setShouldAppendHMAC(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 "algorithm": return java.lang.String.class;
        case "algorithmparameterspec":
        case "algorithmParameterSpec": return java.security.spec.AlgorithmParameterSpec.class;
        case "buffersize":
        case "bufferSize": return int.class;
        case "cryptoprovider":
        case "cryptoProvider": return java.lang.String.class;
        case "initvector":
        case "initVector": return byte[].class;
        case "inline": return boolean.class;
        case "key": return java.security.Key.class;
        case "macalgorithm":
        case "macAlgorithm": return java.lang.String.class;
        case "shouldappendhmac":
        case "shouldAppendHMAC": return boolean.class;
        default: return null;
        }
    }

    @Override
    public Object getOptionValue(Object obj, String name, boolean ignoreCase) {
        CryptoDataFormat target = (CryptoDataFormat) obj;
        switch (ignoreCase ? name.toLowerCase() : name) {
        case "algorithm": return target.getAlgorithm();
        case "algorithmparameterspec":
        case "algorithmParameterSpec": return target.getAlgorithmParameterSpec();
        case "buffersize":
        case "bufferSize": return target.getBufferSize();
        case "cryptoprovider":
        case "cryptoProvider": return target.getCryptoProvider();
        case "initvector":
        case "initVector": return target.getInitVector();
        case "inline": return target.isInline();
        case "key": return target.getKey();
        case "macalgorithm":
        case "macAlgorithm": return target.getMacAlgorithm();
        case "shouldappendhmac":
        case "shouldAppendHMAC": return target.isShouldAppendHMAC();
        default: return null;
        }
    }
}

