package com.vetti.common.enums;
/**
 * 国际化语言类型枚举
 * @author Wangxiangshun
 */
public enum LanguageTypeEnum {

    ZH("zh", "CN"),
    EN("en", "US"),
    JA("ja", "JP"),
    ;

    private final String code;
    private final String info;

    LanguageTypeEnum(String code, String info)
    {
        this.code = code;
        this.info = info;
    }

    public String getCode()
    {
        return code;
    }

    public String getInfo()
    {
        return info;
    }

    public static LanguageTypeEnum getByInfo(String code) {
        LanguageTypeEnum[] statusEnums = values();
        for (LanguageTypeEnum statusEnum : statusEnums) {
            if (statusEnum.getCode().equals(code)) {
                return statusEnum;
            }
        }
        return null;
    }
}
