package cz.moneta.test.harness.data;

import java.util.Arrays;

public enum Browser {

    GOOGLE_CHROME("chrome"),
    MS_EDGE("edge"),
    NOT_SUPPORTED("not_supported");

    private String configName;

    Browser(String configName) {
        this.configName = configName;
    }

    public String getConfigName() {
        return configName;
    }

    public static Browser getBrowserByConfigName(String configName) {
        return Arrays.stream(values())
                .filter(browser -> browser.getConfigName().equals(configName.trim().toLowerCase()))
                .findFirst()
                .orElse(NOT_SUPPORTED);
    }
}
