public class J2CacheUtils extends Object
Modifier and Type | Field and Description |
---|---|
static String |
SHOP_CACHE_NAME
商城业务缓存
|
Constructor and Description |
---|
J2CacheUtils() |
Modifier and Type | Method and Description |
---|---|
static int |
check(String region,
String key)
判断某个key存在于哪级的缓存中
|
static void |
clear(String cacheName)
Clear the cache
|
static void |
delByClass(String className,
String methodName)
删除缓存
|
static boolean |
exists(String key)
判断某个缓存键是否存在
|
static boolean |
exists(String region,
String key)
判断某个缓存键是否存在
|
static Object |
get(String key)
获取SYS_CACHE_NAME缓存
|
static Object |
get(String cacheName,
String key)
获取缓存
|
static Collection<String> |
keys()
获取SYS_CACHE缓存的所有key
|
static Collection<String> |
keys(String cacheName)
获取缓存的所有key
|
static void |
put(String key,
Object value)
写入SYS_CACHE_NAME缓存
|
static void |
put(String cacheName,
String key,
Object value)
写入缓存
|
static void |
remove(String key)
从SYS_CACHE_NAME缓存中移除
|
static void |
remove(String cacheName,
String key)
从缓存中移除
|
public static String SHOP_CACHE_NAME
public static void remove(String key)
key
- public static Object get(String cacheName, String key)
cacheName
- key
- public static void put(String cacheName, String key, Object value)
cacheName
- key
- value
- public static Collection<String> keys()
public static Collection<String> keys(String cacheName)
cacheName
- public static void clear(String cacheName)
cacheName:
- Cache region namepublic static boolean exists(String region, String key)
region
- Cache region namekey
- cache keypublic static boolean exists(String key)
key
- cache keypublic static int check(String region, String key)
region
- cache regionkey
- cache keyCopyright © 2021. All rights reserved.