All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.github.qq275860560.common.util.CacheUtil Maven / Gradle / Ivy

There is a newer version: 201905061822
Show newest version
package com.github.qq275860560.common.util;

import java.util.concurrent.ConcurrentHashMap;

/**
 * @author [email protected]
 * 仿照redis的语法建立的本地jvm缓存 *
 */
public class CacheUtil {

	public static ConcurrentHashMap map = new ConcurrentHashMap<>();

	public static boolean exists(String key) {
		return map.containsKey(key);
	}

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

	public static void set(String key, Object object) {
		map.put(key, object);
	}

	public static void del(String key) {
		map.remove(key);
	}

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy