Interface RefreshAheadPolicy.RefreshPredicate<K>
- Type Parameters:
K- the key type | 键类型
- Enclosing interface:
RefreshAheadPolicy<K,V>
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
Predicate interface for custom refresh logic
用于自定义刷新逻辑的断言接口
- Since:
- JDK 25, opencode-base-cache V1.0.0
- Author:
- Leon Soo www.LeonSoo.com
-
Method Summary
Modifier and TypeMethodDescriptionbooleanshouldRefresh(K key, long ageMillis, long ttlMillis) Determine if refresh is needed 确定是否需要刷新
-
Method Details
-
shouldRefresh
Determine if refresh is needed 确定是否需要刷新- Parameters:
key- the key | 键ageMillis- age in milliseconds | 年龄(毫秒)ttlMillis- TTL in milliseconds | TTL(毫秒)- Returns:
- true if refresh needed | 如果需要刷新返回 true
-