package com.energy.manage.common.enums;

/**
 * 类型枚举
 */
public enum TypeRelationEnum {


    COMPANY_NUMBER("company", "企业信息类型"),
    WIND_FIELD_NUMBER("field", "风场信息类型"),
    WIND_GROUP_NUMBER("engine", "风机信息类型");

    TypeRelationEnum(String code, String name) {
        this.code = code;
        this.name = name;
    }

    private String code;
    private String name;


    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public static String getKeyByValue(String code) {
        for (TypeRelationEnum e : values()) {
            if (code.equals(e.code)) {
                return e.name;
            }
        }
        return "Not exist";
    }

    public static TypeRelationEnum getFastReplyType(String code) {
        for (TypeRelationEnum e : values()) {
            if (code.equals(e.code)) {
                return e;
            }
        }
        return null;
    }


}
