MapStorageAccess class
A map-based storage plugin.
You can use it to store entities in a map, window.localStorage
and window.sessionStorage
.
Note: this implementation supports cache. It is mainly designed for using on the client. If you don't want, you can pass a dummy EntityCache to MapStorageAccess.by.
- Implemented types
Constructors
-
MapStorageAccess([Map<
String, String> ? storage]) -
MapStorageAccess.by(EntityCache cache, [Map<
String, String> ? storage])
Properties
- agent → AccessAgent
-
The interface for accessing the storage (aka., database).
*
no setteroverride
- hashCode → int
-
The hash code for this object.
no setterinherited
- reader → AccessReader
-
The access reader for converting data from what the database returns.
latefinal
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- writer → AccessWriter
-
The access writer for converting data into what the database accepts.
final
Methods
-
cache<
T extends Entity> (T entity) → T -
Caches the entity.
It returns
entity
directly.override -
clearCache(
) → void - Clear the cache.
-
fetch<
T extends Entity> (String? otype, String? oid) → T? -
Returns the entity of the given OID, if it is stored in the cache.
override
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
uncache(
String? otype, String? oid) → Entity? -
Removes the caching of the entity of the given
otype
andoid
.override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited