Defines the interface for storage operations on serializable objects of
type E.
This interface provides a contract for performing CRUD (Create, Read, Update, Delete) operations on objects that can be serialized and deserialized to and from string representations.
Type parameters:
E- The type of objects stored in the container.
- Implementers
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
-
isEmpty
→ Future<
bool> -
Returns
trueif the storage contains no objects.no setter -
isNotEmpty
→ Future<
bool> -
Returns
trueif the storage contains one or more objects.no setter - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
add(
E value) → Future< void> - Adds a new object to the storage, generating a new ID for it.
-
addAll(
Iterable< E> values) → Future<void> - Adds multiple new objects to the storage, generating new IDs for them.
-
clear(
) → Future< void> - Removes all objects from the storage.
-
close(
) → Future< void> - Closes the storage and releases any resources.
-
containsKey(
String key) → Future< bool> -
Returns
trueif an object with the givenkeyexists in the storage. -
deserialize(
String value) → E -
Deserializes a String representation into an object of type
E. -
get(
String? key) → Future< E?> -
Retrieves an object by its
key. -
getAll(
[Iterable< String> ? allowList]) → Future<Map< String, E> > - Retrieves all objects from the storage.
-
getKeys(
) → Future< Set< String> > - Returns a set of all keys in the storage.
-
getValues(
) → Future< List< E> > - Retrieves all objects from the storage as a list.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
remove(
String key) → Future< void> -
Removes an object by its
key. -
removeAll(
Iterable< String> keys) → Future<void> - Removes multiple objects by their keys.
-
removeAllItems(
Iterable< E> items) → Future<void> - Removes multiple objects from the storage.
-
removeItem(
E item) → Future< void> - Removes an object from the storage.
-
serialize(
E value) → String -
Serializes an object of type
Einto a String representation. -
set(
String key, E value) → Future< void> -
Saves an object with the given
key. -
setAll(
Map< String, E> items) → Future<void> - Saves multiple objects from a Map of key-value pairs.
-
toString(
) → String -
A string representation of this object.
inherited
-
update(
E value) → Future< void> - Updates an existing object in the storage.
-
updateAll(
Iterable< E> values) → Future<void> - Updates multiple existing objects in the storage.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited