mirror of
https://github.com/LamGC/ContentGrabbingJi.git
synced 2025-04-29 14:17:33 +00:00
[Change] CacheStore-API, CacheStore-Local, CacheStore-Redis 调整 MapCacheStore.putAll 方法参数;
[Change] MapCacheStore 调整 'putAll' 方法的泛型, 以兼容类型的子类; [Change] HashMapCacheStore, RedisMapCacheStore 适配更改;
This commit is contained in:
parent
edb709fb0d
commit
a090abc9a4
@ -67,7 +67,7 @@ public interface MapCacheStore<V> extends CacheStore<Map<String, V>> {
|
||||
* @return 如果成功返回 true.
|
||||
* @throws NullPointerException 当 key/map 为 null 时抛出, 缓存存储容器不允许出现 null 值.
|
||||
*/
|
||||
boolean putAll(CacheKey key, Map<String, V> map);
|
||||
boolean putAll(CacheKey key, Map<? extends String, ? extends V> map);
|
||||
|
||||
/**
|
||||
* 如果字段不存在, 则会将指定的值与此映射中的指定字段关联.
|
||||
|
@ -56,7 +56,7 @@ public class HashMapCacheStore<V> extends HashCacheStore<Map<String, V>> impleme
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean putAll(CacheKey key, Map<String, V> map) {
|
||||
public boolean putAll(CacheKey key, Map<? extends String, ? extends V> map) {
|
||||
return getMap(key, true, keyMap -> {
|
||||
keyMap.putAll(Objects.requireNonNull(map));
|
||||
return true;
|
||||
|
@ -107,7 +107,7 @@ public class RedisMapCacheStore<V> extends RedisCacheStore<Map<String, V>> imple
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean putAll(CacheKey key, Map<String, V> map) {
|
||||
public boolean putAll(CacheKey key, Map<? extends String, ? extends V> map) {
|
||||
Objects.requireNonNull(key);
|
||||
Objects.requireNonNull(map);
|
||||
if (map.size() == 0) {
|
||||
|
Loading…
Reference in New Issue
Block a user