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.

@FunctionalInterface public static interface RefreshAheadPolicy.RefreshPredicate<K>
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 Type
    Method
    Description
    boolean
    shouldRefresh(K key, long ageMillis, long ttlMillis)
    Determine if refresh is needed 确定是否需要刷新
  • Method Details

    • shouldRefresh

      boolean shouldRefresh(K key, long ageMillis, long ttlMillis)
      Determine if refresh is needed 确定是否需要刷新
      Parameters:
      key - the key | 键
      ageMillis - age in milliseconds | 年龄(毫秒)
      ttlMillis - TTL in milliseconds | TTL(毫秒)
      Returns:
      true if refresh needed | 如果需要刷新返回 true