<commit_before>package org.jboss.windup.config.graphsearch;

import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;

import org.jboss.windup.config.GraphRewrite;
import org.jboss.windup.config.condition.GraphCondition;
import org.jboss.windup.config.selectables.VarStack;
import org.jboss.windup.graph.model.WindupVertexFrame;
import org.ocpsoft.rewrite.context.EvaluationContext;

import com.tinkerpop.blueprints.Vertex;
import com.tinkerpop.frames.FramedGraphQuery;

/**
 * The GraphSearchConditionBuilderGremlin criteria just exposes the GremlinPipeline
 */
public class GraphSearchConditionBuilder extends GraphCondition
{
    private final String variableName;
    private final List<GraphSearchCriterion> graphSearchCriteria = new ArrayList<>();

    private GraphSearchConditionBuilder(String variableName)
    {
        this.variableName = variableName;
    }

    public static GraphSearchConditionBuilder create(String collectionName)
    {
        return new GraphSearchConditionBuilder(collectionName);
    }

    public GraphSearchConditionBuilderGremlin gremlin()
    {
        if (graphSearchCriteria.isEmpty())
        {
            throw new IllegalArgumentException(
                        "You must apply at least one basic filter (type or property based) before switching to Gremlin");
        }
        return new GraphSearchConditionBuilderGremlin(this);
    }

    public GraphSearchConditionBuilder ofType(Class<? extends WindupVertexFrame> clazz)<commit_msg>WINDUP-112: Create method for adding a GraphSearchCriterio to GraphSearchConditionBuilder<commit_after>package org.jboss.windup.config.graphsearch;

import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;

import org.jboss.windup.config.GraphRewrite;
import org.jboss.windup.config.condition.GraphCondition;
import org.jboss.windup.config.selectables.VarStack;
import org.jboss.windup.graph.model.WindupVertexFrame;
import org.ocpsoft.rewrite.context.EvaluationContext;

import com.tinkerpop.blueprints.Vertex;
import com.tinkerpop.frames.FramedGraphQuery;

/**
 * The GraphSearchConditionBuilderGremlin criteria just exposes the GremlinPipeline
 */
public class GraphSearchConditionBuilder extends GraphCondition
{
    private final String variableName;
    private final List<GraphSearchCriterion> graphSearchCriteria = new ArrayList<>();

    private GraphSearchConditionBuilder(String variableName)
    {
        this.variableName = variableName;
    }

    public static GraphSearchConditionBuilder create(String collectionName)
    {
        return new GraphSearchConditionBuilder(collectionName);
    }
    
    public GraphSearchConditionBuilder addSearchCriterion(GraphSearchCriterion criterion) 
    {
    	graphSearchCriteria.add(criterion);
    	return this;
    }

    public GraphSearchConditionBuilderGremlin gremlin()
    {
        if (graphSearchCriteria.isEmpty())
        {
            throw new IllegalArgumentException(
                        "You must apply at least one basic filter (type or property based) before switching to Gremlin");
        }
        return new GraphSearchConditionBuilderGremlin(this);
    }

    public GraphSearchConditionBuilder ofType(Class<? extends WindupVertexFrame> clazz)
{'fraction_non_alphanumeric': 0.07123370718399515, 'fraction_numerical': 0.0009093664746892998, 'mean_word_length': 4.2215189873417724, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2774915', 'n_tokens_mistral': 888, 'n_tokens_neox': 838, 'n_words': 198}