CacheEntry<K, V, U extends Object> class

A cache entry, containing a key, value and some metadata.

Inheritance

Constructors

CacheEntry({required V value, required K key, required DateTime added, required DateTime lastAccess, required int numUses, required Set<U> users})
const
CacheEntry.build(V value, EntryInfo<K, U> info)
factory

Properties

added DateTime
When the entry was first added to the cache.
finalinherited
hashCode int
The hash code for this object.
no setterinherited
key → K
The key of the entry.
finalinherited
lastAccess DateTime
When the entry was last read.
finalinherited
numUses int
The number of times the entry has been read.
finalinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
users Set<U>
Users that are currently registered to this entry.
finalinherited
value → V
The value of the entry.
final

Methods

addUsers(Set<U> users) EntryInfo<K, U>
Adds users to the entry's user list.
inherited
copyWith({K? key, DateTime? added, DateTime? lastAccess, int? numUses, Set<U>? users}) EntryInfo<K, U>
Creates a copy of this entry with some values changed.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
removeUsers(Set<U> users) EntryInfo<K, U>
Removes users from the entry's user list.
inherited
toString() String
A string representation of this object.
override
update() EntryInfo<K, U>
Sets lastAccess to now and increments numUses.
inherited

Operators

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