EntryInfo<K, U extends Object> class

Used internally to hold cache entry metadata within Cachette.

Implementers

Constructors

EntryInfo({required K key, required DateTime added, required DateTime lastAccess, int numUses = 0, Set<U> users = const {}})
const
EntryInfo.create(K key, [Set<U>? users])
factory

Properties

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

Methods

addUsers(Set<U> users) EntryInfo<K, U>
Adds users to the entry's user list.
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.
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.
toString() String
A string representation of this object.
inherited
update() EntryInfo<K, U>
Sets lastAccess to now and increments numUses.

Operators

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