All Downloads are FREE. Search and download functionalities are using the official Maven repository.

gherkin.GherkinDialect Maven / Gradle / Ivy

package gherkin;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

public class GherkinDialect {
    private final Map> keywords;
    private String language;

    public GherkinDialect(String language, Map> keywords) {
        this.language = language;
        this.keywords = keywords;
    }

    public List getFeatureKeywords() {
        return keywords.get("feature");
    }

    public List getScenarioKeywords() {
        return keywords.get("scenario");
    }

    public List getStepKeywords() {
        List result = new ArrayList<>();
        result.addAll(keywords.get("given"));
        result.addAll(keywords.get("when"));
        result.addAll(keywords.get("then"));
        result.addAll(keywords.get("and"));
        result.addAll(keywords.get("but"));
        return result;
    }

    public List getBackgroundKeywords() {
        return keywords.get("background");
    }

    public List getScenarioOutlineKeywords() {
        return keywords.get("scenarioOutline");
    }

    public List getExamplesKeywords() {
        return keywords.get("examples");
    }

    public String getLanguage() {
        return language;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy