mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-07-21 15:09:48 +08:00
匿名类替换为lambda表达式
This commit is contained in:
@@ -1,12 +1,12 @@
|
||||
package cn.hutool.cache.impl;
|
||||
|
||||
import cn.hutool.cache.GlobalPruneTimer;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.ScheduledFuture;
|
||||
|
||||
import cn.hutool.cache.GlobalPruneTimer;
|
||||
|
||||
/**
|
||||
* 定时缓存<br>
|
||||
* 此缓存没有容量限制,对象只有在过期后才会被移除
|
||||
@@ -72,12 +72,7 @@ public class TimedCache<K, V> extends AbstractCache<K, V> {
|
||||
* @param delay 间隔时长,单位毫秒
|
||||
*/
|
||||
public void schedulePrune(long delay) {
|
||||
this.pruneJobFuture = GlobalPruneTimer.INSTANCE.schedule(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
prune();
|
||||
}
|
||||
}, delay);
|
||||
this.pruneJobFuture = GlobalPruneTimer.INSTANCE.schedule(this::prune, delay);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user