The type of keys in the cache. 缓存键的类型。
The type of values in the cache. 缓存值的类型。
Creates an instance of LRUCacheWithTTL. 创建LRUCacheWithTTL的实例。
The type of keys in the cache. 缓存键的类型。
The type of values in the cache. 缓存值的类型。
Maximum number of items the cache can hold. Must be a positive integer. 缓存可容纳的最大项目数。必须为正整数。
Time to live for cache items in milliseconds. Must be a positive integer. 缓存项的生存时间(毫秒)。必须为正整数。
Gets the maximum capacity of the cache. 获取缓存的最大容量。
The cache capacity. 缓存容量。
Gets the current number of items in the cache. 获取缓存中当前的项目数量。
The number of items in the cache. 缓存中的项目数量。
Removes all expired items from the cache. 从缓存中移除所有过期的项目。
The number of items removed. 移除的项目数量。
Clears all items from the cache. 清除缓存中的所有项目。
Deletes a specific key from the cache. 从缓存中删除特定的键。
The key to delete. 要删除的键。
True if the key was deleted, false if it didn't exist. 如果键被删除则返回true,如果键不存在则返回false。
Checks if a key exists in the cache and is not expired. 检查键是否存在于缓存中且未过期。
The key to check. 要检查的键。
True if the key exists and is not expired, false otherwise. 如果键存在且未过期则返回true,否则返回false。
Sets a key-value pair in the cache. 在缓存中设置键值对。
LRU (Least Recently Used) cache with TTL (Time To Live) support. 支持TTL(生存时间)的LRU(最近最少使用)缓存。