package com.chenyang.nse.bussiness.webtools.tools.redis;

import cn.hutool.core.util.ObjectUtil;
import java.util.HashMap;
import java.util.Map;
import org.springframework.stereotype.Component;

@Component("webtoolsCacheUtil")
public class CacheUtil {
   public static Map<String, Object> cacheManager = new HashMap();

   public static void put(String key, Object value) {
      cacheManager.put(key, value);
   }

   public static Object getCacheValue(String key) {
      return cacheManager.get(key);
   }

   public static void delCacheValue(String key) {
      cacheManager.remove(key);
   }

   public static boolean exists(final String key) {
      return !ObjectUtil.isEmpty(getCacheValue(key));
   }
}
