CacheMetadata class
缓存条目元数据
记录每个缓存条目的访问信息,用于 LRU/LFU/FIFO 淘汰策略。
Constructors
- CacheMetadata({required int createdAt, int? lastAccessedAt, int? accessCount})
-
CacheMetadata.fromMap(Map<
String, dynamic> map) -
从 Map 反序列化
factory
Properties
- accessCount ↔ int
-
访问次数,每次读取时递增
getter/setter pair
- createdAt → int
-
条目创建时间(毫秒时间戳)
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- lastAccessedAt ↔ int
-
最后访问时间(毫秒时间戳),每次读取时更新
getter/setter pair
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
recordAccess(
) → void - 记录一次访问(更新 lastAccessedAt 和 accessCount)
-
toMap(
) → Map< String, dynamic> - 序列化为 Map,用于存储到数据库
-
toString(
) → String -
A string representation of this object.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited