MapCache<K, V> class

A Cache that's backed by a Map.

Implemented types

Constructors

MapCache({Map<K, V>? map})
Creates a new MapCache, optionally using map as the backing Map.
MapCache.lru({int? maximumSize})
Creates a new MapCache, using LruMap as the backing Map.
factory

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

get(K key, {Loader<K, V>? ifAbsent}) Future<V?>
Returns the value associated with key.
override
invalidate(K key) Future<void>
Removes the value associated with key. The Future completes when the operation is complete.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
set(K key, V value) Future<void>
Sets the value associated with key. The Future completes when the operation is complete.
override
toString() String
A string representation of this object.
inherited

Operators

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