MemoryCache<T> class

Memory cache implementation

Constructors

MemoryCache({CacheStrategy? strategy})

Properties

hashCode int
The hash code for this object.
no setterinherited
keys List<String>
Get all keys
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
size int
Get cache size
no setter
strategy CacheStrategy
final

Methods

cleanExpired() → void
Clean expired entries
clear() → void
Clear all cached data
get(String key) CachedData<T>?
Get cached data
getStats() Map<String, dynamic>
Get cache statistics
has(String key) bool
Check if key exists and is not expired
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
remove(String key) → void
Remove cached data
set(String key, T data, {Duration? ttl}) → void
Set cached data
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited