GenericVault<T> class
Generic implementation of the Vault interface
- Implemented types
-
- Vault<
T>
- Vault<
- Available extensions
Constructors
-
GenericVault(Store<
VaultInfo, VaultEntry> storage, {VaultManager? manager, String? name, VaultLoader<T> ? vaultLoader, Clock? clock, EventListenerMode? eventListenerMode, bool? statsEnabled, VaultStats? stats}) - Builds a GenericVault out of a mandatory Store and a set of optional configurations
Properties
- clock → Clock
-
The source of time to be used on this vault
final
- eventPublishingMode → EventListenerMode
-
The event publishing mode of this vault
final
- hashCode → int
-
The hash code for this object.
no setterinherited
-
keys
→ Future<
Iterable< String> > -
Returns a
Iterable
over all the Stash keysno setteroverride - manager → VaultManager?
-
Gets the VaultManager that owns and manages the Vault.
Returns the manager or
null
if the Vault is not managedfinal - name → String
-
The name of this vault
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
size
→ Future<
int> -
The number of entries on the stash
no setteroverride
- stats → VaultStats
-
final
- statsEnabled → bool
-
final
-
storage
→ Store<
VaultInfo, VaultEntry> -
The Store for this vault
final
- streamController → StreamController
-
The StreamController for this vault events
final
-
vaultLoader
→ VaultLoader<
T?> -
The VaultLoader for this vault. When set it's used whenever
a get by key returns null
final
Methods
-
clear(
) → Future< void> -
Clears the contents of the stash
override
-
close(
) → Future< void> -
Closes the stash
override
-
containsKey(
String key) → Future< bool> -
Determines if the Stash contains an entry for the specified
key
.override -
get(
String key, {VaultEntryDelegate< T> ? delegate}) → Future<T?> -
Returns the vault value for the specified
key
.override -
getAll(
Set< String> keys) → Future<Map< String, T?> > -
Available on Stash<
Gets the stash values for the specified set ofT> , provided by the StashExtension extensionkeys
-
getAndPut(
String key, T value, {VaultEntryDelegate< T> ? delegate}) → Future<T?> -
Associates the specified
value
with the specifiedkey
in this cache, returning an existing value if one existed. If the cache previously contained a mapping for thekey
, the old value is replaced by the specified value.override -
getAndRemove(
String key) → Future< T?> -
Removes the entry for a
key
only if currently mapped to some value.override -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
on<
E extends VaultEvent< (T> >) → Stream< E> -
Listens for events of Type
T
and its subtypes.override -
put(
String key, T value, {VaultEntryDelegate< T> ? delegate}) → Future<void> -
Add / Replace the vault
value
for the specifiedkey
.override -
putAll(
Map< String, T> map) → Future<void> -
Available on Stash<
Add / Replace the stash values with the specifiedT> , provided by the StashExtension extensionmap
of entries. -
putIfAbsent(
String key, T value, {VaultEntryDelegate< T> ? delegate}) → Future<bool> -
Associates the specified
key
with the givenvalue
override -
remove(
String key) → Future< void> -
Removes the value stored under a key from this stash if present.
override
-
removeAll(
Set< String> keys) → Future<void> -
Available on Stash<
Removes the values stored under a set of keys from this stashT> , provided by the StashExtension extension -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
-
operator [](
String key) → Future< T?> -
Get the stash value for the specified
key
.override