package foundation.data.entity;
|
|
public class DictionaryTranslator {
|
|
private IDictionary dictionary;
|
|
private DictionaryTranslator() {
|
|
}
|
|
public static DictionaryTranslator getInstance(String name) {
|
IDictionary dictionary = IDictionaryBucket.getOne(name);
|
|
if (dictionary == null) {
|
return null;
|
}
|
|
DictionaryTranslator translator = new DictionaryTranslator();
|
translator.dictionary = dictionary;
|
|
return translator;
|
}
|
|
public String toValue(String code) {
|
String value = dictionary.getValue(code);
|
return value;
|
}
|
|
}
|