MapAsCacheExtension<K, V> extension
Extension that ads cached methods to a Map.
- on
-
- Map<
K, V>
- Map<
Methods
-
checkCachedEntry(
K key) → void -
Available on Map<
K, V> , provided by the MapAsCacheExtension extension -
checkCacheLimit(
int? cacheLimit) → int -
Available on Map<
Checks if this Map.length is bigger thanK, V> , provided by the MapAsCacheExtension extensioncacheLimit
and removes elements to not exceed thecacheLimit
. -
getCached(
K key, V computer(), {int? cacheLimit}) → V -
Available on Map<
ReturnsK, V> , provided by the MapAsCacheExtension extensionkey
value or computes it and caches it. See checkCachedEntry, checkCacheLimit and getCachedAsync. -
getCachedAsync(
K key, FutureOr< V> computer(), {int? cacheLimit}) → FutureOr<V> -
Available on Map<
Same as getCached but accepts aK, V> , provided by the MapAsCacheExtension extensioncomputer
that returns a Future. See checkCachedEntry, checkCacheLimit and getCachedAsync. -
getCachedAsyncNullable(
K key, FutureOr< V?> computer(), {int? cacheLimit}) → FutureOr<V?> -
Available on Map<
K, V> , provided by the MapAsCacheExtension extension -
getCachedNullable(
K key, V? computer(), {int? cacheLimit}) → V? -
Available on Map<
K, V> , provided by the MapAsCacheExtension extension -
getIfCached(
K key, {int? cacheLimit}) → V? -
Available on Map<
ReturnsK, V> , provided by the MapAsCacheExtension extensionkey
value, checking if it's still valid. See checkCachedEntry and checkCacheLimit.