package com.bytesw.bytebot.model.enums;

import java.util.HashMap;
import java.util.Map;
import java.util.NoSuchElementException;

public enum AgentTypeEnum {
    FREQUENT_QUESTION("FQ");

    private final String name;

    private static final Map<String, AgentTypeEnum> map = new HashMap<>();

    static {
        for (AgentTypeEnum type : AgentTypeEnum.values()) {
            map.put(type.name, type);
        }
    }

    AgentTypeEnum(String name) {
        this.name = name;
    }

    public String getName() {
        return name;
    }

    public static AgentTypeEnum fromString(String name) {
        if (map.containsKey(name)) {
            return map.get(name);
        }
        throw new NoSuchElementException(name + " not found");
    }
}
