package com.gps808.common.translation; import com.framework.web.cache.LanguageCache; public class CommonTypeTranslation { /** * 人脸库协议 */ public enum FaceProtocol{ //无 NOTHING(0,"nothing"), //部标主动安全(吉标) STANDARD1078JIBIAO(14,"standard1078JiBiao"), //部标主动安全(湘标) STANDARD1078XIANGBIAO(18,"standard1078XiangBiao"); FaceProtocol(Integer typeValue, String tyepLang){ this.typeValue=typeValue; this.tyepLang=tyepLang; } private final Integer typeValue; private final String tyepLang; /** * 根据value获取lang * @param typeValue * @return */ public static String getLangByValue(Integer typeValue, String language) throws Exception { if (typeValue == null) { return LanguageCache.getText("nothing", language); } FaceProtocol[] values = values(); for (FaceProtocol value : values) { if (value.getTypeValue().equals(typeValue)) { return LanguageCache.getText(value.getTypeLang(), language); } } return LanguageCache.getText("nothing", language); } public Integer getTypeValue() { return this.typeValue; } public String getTypeLang() { return this.tyepLang; } } }