NullStore class
No-op store for disabled or intentionally non-persistent caching.
Writes report success but are discarded, reads report misses, and locks do not provide mutual exclusion. This is useful for optional caching paths, but it must not be used when data durability or concurrency protection is required.
- Inheritance
-
- Object
- TaggableStore
- NullStore
- Implemented types
Constructors
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
-
add(
String key, dynamic value, int seconds) → Future< bool> -
Discards
valueand reports a successful conditional write.override -
decrement(
String key, [dynamic value = 1]) → Future -
Returns the negated requested decrement because no value is persisted.
override
-
flush(
) → Future< bool> -
Reports a successful flush without changing state.
override
-
forever(
String key, dynamic value) → Future< bool> -
Discards
valueand reports a successful non-expiring write.override -
forget(
String key) → Future< bool> -
Reports a successful removal even though no entry is stored.
override
-
get(
String key) → Future -
Always reports a cache miss.
override
-
getAllKeys(
) → Future< List< String> > -
Returns an empty key list because this store retains no entries.
override
-
getPrefix(
) → String -
Returns the empty key prefix.
override
-
increment(
String key, [dynamic value = 1]) → Future -
Returns the requested increment because no value is persisted.
override
-
lock(
String name, [int seconds = 0, String? owner]) → Future< Lock> -
Creates a no-op lock handle for
name.override -
many(
List< String> keys) → Future<Map< String, dynamic> > -
Returns an empty result for every requested key.
override
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
put(
String key, dynamic value, int seconds) → Future< bool> -
Discards
valueand reports a successful write.override -
putMany(
Map< String, dynamic> values, int seconds) → Future<bool> -
Discards all
valuesand reports success.override -
restoreLock(
String name, String owner) → Future< Lock> -
Restores an acquired no-op lock handle for
nameandowner.override -
Creates a
TaggedCacheinstance with the specified tags.inherited -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited