TtlCache<K extends Object, V extends Object> class

TTL cache (expire after duration). Roadmap #195.

Constructors

TtlCache(Duration ttl)
Creates a cache whose entries each expire ttl after being stored.

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
ttl Duration
Time-to-live for each entry; expired entries return null from get.
no setter

Methods

clear() → void
Removes all entries.
get(K key) → V?
Returns the value for key if not expired, or null.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
set(K key, V value) → void
Stores value under key with a fresh expiry ttl from now.
toString() String
A string representation of this object.
override

Operators

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