SharedMap<K, V> class
abstract
Base class for SharedMap implementations.
- Inheritance
-
- Object
- ReferenceableType
- SharedMap
- Implementers
Constructors
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- id → String
-
The ID of the referenceable instance.
no setterinherited
-
onAbsent
↔ SharedMapKeyCallback<
K, V> ? -
Optional callback for when an entry is accessed and is absent.
getter/setter pair
- onInitialize ↔ SharedMapEventCallback?
-
Optional callback for when the SharedMap instance is initialized.
getter/setter pair
-
onPut
↔ SharedMapEntryCallback<
K, V> ? -
Optional callback for when put is called.
getter/setter pair
-
onRemove
↔ SharedMapEntryCallback<
K, V> ? -
Optional callback for when remove is called.
getter/setter pair
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
The SharedStore where this instance is stored/handled.
no setter
Methods
-
cached(
{Duration? timeout}) → SharedMapCached< K, V> - Returns a cached version of this instance.
-
clear(
) → FutureOr< int> - Clears all the entries and returns the amount of removed entries.
-
entries(
) → FutureOr< List< MapEntry< >K, V> > - Returns all the entries.
-
get(
K key) → FutureOr< V?> -
Returns the value of
key
. -
keys(
) → FutureOr< List< K> > - Returns all the keys.
-
length(
) → FutureOr< int> - Returns keys length.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
put(
K key, V? value) → FutureOr< V?> -
Sets the
value
ofkey
and returns it. -
putIfAbsent(
K key, V? absentValue) → FutureOr< V?> -
Sets the
absentValue
ofkey
if it'snull
, and returns it. If thekey
value is already define and is NOTnull
, returns the previous value. -
remove(
K key) → FutureOr< V?> -
Remove the
key
entry and return the removed value. -
removeAll(
List< K> keys) → FutureOr<List< V?> > -
Remove the
keys
entries and return the removed values. -
setCallbacks(
{SharedMapEventCallback? onInitialize, SharedMapKeyCallback< K, V> ? onAbsent, SharedMapEntryCallback<K, V> ? onPut, SharedMapEntryCallback<K, V> ? onRemove}) → void -
setCallbacksDynamic<
K1, V1> ({SharedMapEventCallback? onInitialize, SharedMapKeyCallback< K1, V1> ? onAbsent, SharedMapEntryCallback<K1, V1> ? onPut, SharedMapEntryCallback<K1, V1> ? onRemove}) → void -
Returns the SharedReference of this instances,
to instantiate it using a
fromSharedReference
constructor.override -
toString(
) → String -
A string representation of this object.
inherited
-
update(
K key, SharedMapUpdater< K, V> updater) → FutureOr<V?> -
Updated the
key
value by running theupdater
code in the same memory context (Isolate
) as the main instance. -
values(
) → FutureOr< List< V> > - Returns all the values.
-
where(
bool test(K key, V value)) → FutureOr< List< MapEntry< >K, V> > -
Returns all the entries that satisfy the predicate
test
.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
from<
K, V> ({SharedMapReference? reference, String? id, SharedMapEventCallback? onInitialize, SharedMapKeyCallback< K, V> ? onAbsent, SharedMapEntryCallback<K, V> ? onPut, SharedMapEntryCallback<K, V> ? onRemove}) → FutureOr<SharedMap< K, V> > -
Creates a SharedMap from
reference
orid
. -
fromID<
K, V> (String id, {SharedMapEventCallback? onInitialize, SharedMapKeyCallback< K, V> ? onAbsent, SharedMapEntryCallback<K, V> ? onPut, SharedMapEntryCallback<K, V> ? onRemove}) → FutureOr<SharedMap< K, V> > -
Creates a SharedMap with
id
. -
fromUUID<
K, V> (→ FutureOr< )SharedMap< K, V> > - Creates a SharedMap using a ReferenceableType.newUUID as id.