add method

This commit is contained in:
Looly
2021-02-20 09:52:17 +08:00
parent 7cee14373a
commit 7527f812cd
3 changed files with 14 additions and 2 deletions

View File

@@ -3,13 +3,14 @@
-------------------------------------------------------------------------------------------------------------
# 5.5.9 (2021-02-18)
# 5.5.9 (2021-02-20)
### 新特性
* 【crypto 】 PemUtil.readPemKey支持ECpr#1366@Github
* 【extra 】 Ftp等cd方法增加同步issue#1397@Github
* 【core 】 StrUtil增加endWithAnyIgnoreCaseissue#I37I0B@Gitee
* 【crypto 】 Sm2增加getD和getQ方法issue#I37Z4C@Gitee
* 【cache 】 AbstractCache增加keySet方法issue#I37Z4C@Gitee
### Bug修复
* 【json 】 JSONUtil.isJson方法改变trim策略解决特殊空白符导致判断失败问题

View File

@@ -7,6 +7,7 @@ import cn.hutool.core.lang.func.Func0;
import java.util.Iterator;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.atomic.AtomicLong;
import java.util.concurrent.locks.Lock;
@@ -312,6 +313,16 @@ public abstract class AbstractCache<K, V> implements Cache<K, V> {
return this;
}
/**
* 返回所有键
*
* @return 所有键
* @since 5.5.9
*/
public Set<K> keySet(){
return this.cacheMap.keySet();
}
/**
* 对象移除回调。默认无动作<br>
* 子类可重写此方法用于监听移除事件如果重写listener将无效

View File

@@ -48,7 +48,7 @@ public class LRUCache<K, V> extends AbstractCache<K, V> {
// ---------------------------------------------------------------- prune
/**
* 只清理超时对象LRU的实现会交给<code>LinkedHashMap</code>
* 只清理超时对象LRU的实现会交给{@code LinkedHashMap}
*/
@Override
protected int pruneCache() {