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

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

    private org.apache.camel.component.langchain4j.embeddingstore.LangChain4jEmbeddingStoreConfiguration getOrCreateConfiguration(LangChain4jEmbeddingStoreComponent target) {
        if (target.getConfiguration() == null) {
            target.setConfiguration(new org.apache.camel.component.langchain4j.embeddingstore.LangChain4jEmbeddingStoreConfiguration());
        }
        return target.getConfiguration();
    }

    @Override
    public boolean configure(CamelContext camelContext, Object obj, String name, Object value, boolean ignoreCase) {
        LangChain4jEmbeddingStoreComponent target = (LangChain4jEmbeddingStoreComponent) obj;
        switch (ignoreCase ? name.toLowerCase() : name) {
        case "action": getOrCreateConfiguration(target).setAction(property(camelContext, org.apache.camel.component.langchain4j.embeddingstore.LangChain4jEmbeddingStoreAction.class, value)); return true;
        case "autowiredenabled":
        case "autowiredEnabled": target.setAutowiredEnabled(property(camelContext, boolean.class, value)); return true;
        case "configuration": target.setConfiguration(property(camelContext, org.apache.camel.component.langchain4j.embeddingstore.LangChain4jEmbeddingStoreConfiguration.class, value)); return true;
        case "embeddingstore":
        case "embeddingStore": getOrCreateConfiguration(target).setEmbeddingStore(property(camelContext, dev.langchain4j.store.embedding.EmbeddingStore.class, value)); return true;
        case "embeddingstorefactory":
        case "embeddingStoreFactory": getOrCreateConfiguration(target).setEmbeddingStoreFactory(property(camelContext, org.apache.camel.component.langchain4j.embeddingstore.EmbeddingStoreFactory.class, value)); return true;
        case "lazystartproducer":
        case "lazyStartProducer": target.setLazyStartProducer(property(camelContext, boolean.class, value)); return true;
        case "maxresults":
        case "maxResults": getOrCreateConfiguration(target).setMaxResults(property(camelContext, java.lang.Integer.class, value)); return true;
        case "minscore":
        case "minScore": getOrCreateConfiguration(target).setMinScore(property(camelContext, java.lang.Double.class, value)); return true;
        case "returntextcontent":
        case "returnTextContent": getOrCreateConfiguration(target).setReturnTextContent(property(camelContext, boolean.class, value)); return true;
        default: return false;
        }
    }

    @Override
    public String[] getAutowiredNames() {
        return new String[]{"embeddingStore", "embeddingStoreFactory"};
    }

    @Override
    public Class<?> getOptionType(String name, boolean ignoreCase) {
        switch (ignoreCase ? name.toLowerCase() : name) {
        case "action": return org.apache.camel.component.langchain4j.embeddingstore.LangChain4jEmbeddingStoreAction.class;
        case "autowiredenabled":
        case "autowiredEnabled": return boolean.class;
        case "configuration": return org.apache.camel.component.langchain4j.embeddingstore.LangChain4jEmbeddingStoreConfiguration.class;
        case "embeddingstore":
        case "embeddingStore": return dev.langchain4j.store.embedding.EmbeddingStore.class;
        case "embeddingstorefactory":
        case "embeddingStoreFactory": return org.apache.camel.component.langchain4j.embeddingstore.EmbeddingStoreFactory.class;
        case "lazystartproducer":
        case "lazyStartProducer": return boolean.class;
        case "maxresults":
        case "maxResults": return java.lang.Integer.class;
        case "minscore":
        case "minScore": return java.lang.Double.class;
        case "returntextcontent":
        case "returnTextContent": return boolean.class;
        default: return null;
        }
    }

    @Override
    public Object getOptionValue(Object obj, String name, boolean ignoreCase) {
        LangChain4jEmbeddingStoreComponent target = (LangChain4jEmbeddingStoreComponent) obj;
        switch (ignoreCase ? name.toLowerCase() : name) {
        case "action": return getOrCreateConfiguration(target).getAction();
        case "autowiredenabled":
        case "autowiredEnabled": return target.isAutowiredEnabled();
        case "configuration": return target.getConfiguration();
        case "embeddingstore":
        case "embeddingStore": return getOrCreateConfiguration(target).getEmbeddingStore();
        case "embeddingstorefactory":
        case "embeddingStoreFactory": return getOrCreateConfiguration(target).getEmbeddingStoreFactory();
        case "lazystartproducer":
        case "lazyStartProducer": return target.isLazyStartProducer();
        case "maxresults":
        case "maxResults": return getOrCreateConfiguration(target).getMaxResults();
        case "minscore":
        case "minScore": return getOrCreateConfiguration(target).getMinScore();
        case "returntextcontent":
        case "returnTextContent": return getOrCreateConfiguration(target).isReturnTextContent();
        default: return null;
        }
    }

    @Override
    public Object getCollectionValueType(Object target, String name, boolean ignoreCase) {
        switch (ignoreCase ? name.toLowerCase() : name) {
        case "embeddingstore":
        case "embeddingStore": return dev.langchain4j.data.segment.TextSegment.class;
        default: return null;
        }
    }
}

