IMemoryCache class abstract
Represents a local in-memory cache whose values are not serialized.
- Implementers
- Available extensions
Constructors
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
clear(
) → void - Removes all keys and values from the cache.
-
compact(
double percentage) → void -
Performs compaction on the cache by removing
percentageof entries. -
containsKey(
Object key) → bool -
Gets a value indicating whether the cache entry associated with
keyexists. -
createEntry(
Object key) → ICacheEntry - Creates or overwrites an entry in the cache.
-
get<
T> (Object key) → T? -
Available on IMemoryCache, provided by the MemoryCacheExtensions extension
Gets the value associated withkey. -
getCurrentStatistics(
) → MemoryCacheStatistics? - Gets a snapshot of the cache statistics.
-
getOrCreate<
T> (Object key, T factory(ICacheEntry entry)) → T -
Available on IMemoryCache, provided by the MemoryCacheExtensions extension
Gets the value associated withkey, or creates and caches a new value usingfactoryif not found. -
getOrCreateAsync<
T> (Object key, Future< T> factory(ICacheEntry entry)) → Future<T> -
Available on IMemoryCache, provided by the MemoryCacheExtensions extension
Async version of getOrCreate. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
remove(
Object key) → void -
Removes the value associated with
keyfrom the cache. -
set<
T> (Object key, T value, [MemoryCacheEntryOptions? options]) → T -
Available on IMemoryCache, provided by the MemoryCacheExtensions extension
Sets the value forkey. -
toString(
) → String -
A string representation of this object.
inherited
-
tryGetValue<
T> (Object key, void setValue(T? value)) → bool -
Gets the value associated with
keyif it exists.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited