package cn.quant.baa.pay.config;

import cn.quant.baa.pay.dict.DictType;
import cn.quant.baa.pay.model.DictionaryItem;
import com.google.common.base.Supplier;
import com.google.common.collect.Maps;
import com.google.common.collect.Table;
import com.google.common.collect.Tables;

import java.util.Map;

/**
 * Created by Administrator on 2021/8/23 0023.
 */
public class DictionaryViewer {
    private Table<String, String, DictionaryItem> bigTable = Tables.newCustomTable(Maps.newHashMap(), new Supplier() {
        public Map<String, DictionaryItem> get() {
            return Maps.newLinkedHashMap();
        }
    });


    public void add(DictionaryItem item) {
        bigTable.put(item.getType(), item.getCode(), item);
    }

    public DictionaryItem get(String type, String code) {
        return bigTable.get(type, code);
    }


}
