mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-07-21 15:09:48 +08:00
add method
This commit is contained in:
@@ -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将无效
|
||||
|
@@ -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() {
|
||||
|
Reference in New Issue
Block a user