package ru.yandex.autotests.direct.web.data.strategy;

import java.util.stream.Stream;

import ru.yandex.autotests.direct.web.util.DirectWebError;

/*
* todo javadoc
*/
public enum StrategyShowType {
    ALL("0"),
    SEARCH("1"),
    NET("2"),
    INDEPENDENT("0");

    StrategyShowType(String radioKey) {
        this.radioKey = radioKey;
    }

    private String radioKey;

    public String getRadioKey() {
        return radioKey;
    }

    public static StrategyShowType getStrategyShowTypeByValue(String value) {
        return Stream.of(values())
                .filter(t -> t.getRadioKey().equals(value))
                .findFirst()
                .orElseThrow(() -> new DirectWebError("Не найдено значение " + value));
    }
}
