package com.diagbot.enums.data;

import lombok.Setter;

public enum ClinicPathwayManageEnum implements AKeyedNamed{
    COMPLETE("1", "完成"),
    VARIATION("2", "变异"),
    QUIT("3", "退出"),
    NO_IN("4", "未入");

    @Setter
    private String key;

    @Setter
    private String name;

    ClinicPathwayManageEnum(String key, String name) {
        this.key = key;
        this.name = name;
    }

    public static ClinicPathwayManageEnum getEnum(String key) {
        for (ClinicPathwayManageEnum item : ClinicPathwayManageEnum.values()) {
            if (key.equals(item.getKey())) {
                return item;
            }
        }
        return null;
    }

    public static String getName(String key) {
        ClinicPathwayManageEnum item = getEnum(key);
        return item != null ? item.name : null;
    }

    @Override
    public String getKey() {
        return key;
    }

    @Override
    public String getName() {
        return name;
    }
}
