package cn.cecep.talroad.enums;

import com.fasterxml.jackson.annotation.JsonCreator;
import java.util.ArrayList;
import java.util.List;

public enum EnIndustry {
    GT("GT", "钢铁"),
    JH("JH", "焦化"),
    SN("SN", "水泥"),
    DL("DL", "电力"),
    BL("BL", "玻璃"),
    FS("FS", "垃圾焚烧"),
    EL("EL", "分表计电");

    private String enumId;
    private String enumTxt;

    EnIndustry(String id, String txt) {
        this.enumId = id;
        this.enumTxt = txt;
    }

    public String id() {
        return this.enumId;
    }

    public String txt() {
        return this.enumTxt;
    }

    @JsonCreator
    public static EnIndustry getEnumById(String id) {
        EnIndustry[] var1 = values();
        int var2 = var1.length;

        for(int var3 = 0; var3 < var2; ++var3) {
            EnIndustry en = var1[var3];
            if (en.id().equalsIgnoreCase(id)) {
                return en;
            }
        }

        return null;
    }

    public static EnIndustry getEnumByName(String name) {
        EnIndustry[] var1 = values();
        int var2 = var1.length;

        for(int var3 = 0; var3 < var2; ++var3) {
            EnIndustry en = var1[var3];
            if (en.name().equalsIgnoreCase(name)) {
                return en;
            }
        }

        return null;
    }

    public static List<String> getIds(){
        List<String> ids = new ArrayList<>();
        for (EnIndustry ems:EnIndustry.values()) {
            ids.add(ems.id());
        }
        return ids;
    }
}
