package com.bocloud.ims.common.cache;

import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

/**
 * 字典缓存
 *
 * @author wewei
 */
public class DictionaryCache {

    private static Map<String, String> dictCache = new ConcurrentHashMap<>(100, 0.9f);

    public static String readCache(String key) {
        if (null == key) {
            return null;
        }
        return dictCache.get(key);
    }

    public static void writeCache(Map<String, String> map) {
        if (null != map) {
            for (String key : map.keySet()) {
                dictCache.put(key, map.get(key));
            }
        }
    }
}
