Package org.miaixz.bus.cache
Interface CacheX
- All Known Implementing Classes:
GuavaCache,MemcachedCache,MemoryCache,NoOpCache,RedisCache,RedisClusterCache
public interface CacheX
缓存接口
- Since:
- Java 17+
- Author:
- Kimi Liu
-
Method Summary
Modifier and TypeMethodDescriptionvoidclear()清空缓存信息default booleancontainsKey(String key) 是否存在key,如果对应key的value值已过期,也返回false从缓存中获得对象read(Collection<String> keys) 从缓存中获得一组对象信息void从缓存中移除对象void将对象加入到缓存,使用指定失效时长void将对象加入到缓存,使用指定失效时长
-
Method Details
-
read
-
read
-
write
-
write
-
containsKey
是否存在key,如果对应key的value值已过期,也返回false- Parameters:
key- 缓存key- Returns:
- true:存在key,并且value没过期;false:key不存在或者已过期
-
remove
-
clear
void clear()清空缓存信息
-