我有一个像这样的loadingcache类:
LoadingCache<Integer, List<Parent>> parents
其中 Parent
是一个具有 id
、description
、home
和 nickname< 的类
我想打印 parents
对象内的所有值
我尝试做类似的事情:
parents.keys()
但我找不到 LoodingCache
对象的方法
最佳答案
您可以使用方法 asMap()
代替:
/**
* Returns a view of the entries stored in this cache as a thread-safe map. Modifications made to
* the map directly affect the cache.
*/
ConcurrentMap<K, V> asMap();
关于java - 如何迭代 LoadingCache 谷歌类,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32095398/