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

com.github.ejahns.KeywordProvider Maven / Gradle / Ivy

package com.github.ejahns;

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

public class KeywordProvider {

	private final String language;
	private final Map> keywords;

	KeywordProvider(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 getBackgroundKeywords() {
		return keywords.get("background");
	}

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

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

	public List getStepKeywords() {
		HashSet keywords = new HashSet<>();
		keywords.addAll(getGivenKeywords());
		keywords.addAll(getWhenKeywords());
		keywords.addAll(getThenKeywords());
		keywords.addAll(getAndKeywords());
		keywords.addAll(getButKeywords());
		return new ArrayList<>(keywords);
	}

	public List getGivenKeywords() {
		return keywords.get("given");
	}

	public List getWhenKeywords() {
		return keywords.get("when");
	}

	public List getThenKeywords() {
		return keywords.get("then");
	}

	public List getAndKeywords() {
		return keywords.get("and");
	}

	public List getButKeywords() {
		return keywords.get("but");
	}

	public String getLanguage() {
		return language;
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy