java - com.google.common.collect.MapMaker 中的过期时间

标签 java guava google-guava-cache

我刚刚下载了最新版本的 Guava

<!-- https://mvnrepository.com/artifact/com.google.guava/guava -->
<dependency>
    <groupId>com.google.guava</groupId>
    <artifactId>guava</artifactId>
    <version>20.0-hal</version>
</dependency>

我发现 MapMaker 类不再有方法 expiration,我发现它很有用,但我还没有找到任何替代方法。

最佳答案

参见MapMakerMigration · google/guava Wiki :

All caching related methods on MapMaker have been deprecated in favor of similar methods in CacheBuilder, and are scheduled for upcoming deletion.

看起来它首先在版本 8.0 中被弃用。并在 13.0 之前删除.

关于java - com.google.common.collect.MapMaker 中的过期时间,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40288457/

相关文章:

java - Guava 中的 ListenableFuture 将在哪个线程中调用 FutureCallback?

java - 将迭代器转换为流并调用并行,转换是否在共享线程池线程上完成?

java - 如何模拟 Google Guava 缓存生成器?

java - Thread.sleep() 实现

java - 为什么 guava Multimap.values() 返回一个平面集合而不是集合的集合?

java - Spring MVC i18n 不工作

jakarta-ee - 谷歌缓存可以在集群环境中工作吗

java - 如何配置 Guava 缓存以在读取后删除项目?

java - 从 JFrame 调整 JPanel 的大小

java - 在 Eclipse 中,如何运行引用一个类的所有 junit 测试