JsonEntityCache class abstract
A JSON entity encoding/decoding cache.
- Implementers
Constructors
Properties
-
allCachedEntities
→ List<
Object> -
Returns all the cached entities of this cache.
Calls instantiateAllCachedEntities before returning the cached entities.
no setter
- allowEntityFetch → bool
-
If
true
it will allow the use of on repository to fetch an entity by an ID reference.no setter -
cachedEntities
→ List<
Object> -
Returns the already instantiated cached entities of this cache.
See allCachedEntities.
no setter
- cachedEntitiesInstantiatorsLength → int
-
Returns the total cached entities instantiators of this cache.
See cacheEntityInstantiator and totalCachedEntities.
no setter
- cachedEntitiesLength → int
-
Returns the total cached entities of this cache.
See cacheEntity and totalCachedEntities.
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- id → int
-
The cache ID.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- totalCachedEntities → int
-
Returns the total number of cached entities and cache entities instantiators.
no setter
Methods
-
cacheEntities<
O> (List< O> entities, [dynamic idGetter(O o)?]) → void -
Caches the List
entities
. This is called by the entity decoder/loader. See cacheEntity. -
cacheEntity<
O> (O entity, [dynamic idGetter(O o)?]) → void -
Caches
entity
. This is called by the entity decoder/loader. See cacheEntities. -
cacheEntityInstantiator<
O> (Object id, O entityInstantiator(), {Type? type, bool overwrite = true}) → void -
Caches an
entityInstantiator
. This is called by the entity decoder/loader. See cacheEntity. -
clearCachedEntities(
) → void - Clears all cached entities of this cache.
-
getCachedEntitiesByIDs<
O> (List ids, {Type? type, bool removeCachedIDs = false}) → Map< dynamic, Object> ? -
Returns the cached entities of
type
withids
. -
getCachedEntityByID<
O> (dynamic id, {Type? type}) → O? -
Returns a cached entity of
type
withid
. -
getCachedEntityByMapID<
O> (Map< Object?, Object?> map, {Type? type}) → O? -
Returns a cached entity of
type
with an id frommap
entries. See getEntityIDFromMap. -
getEntityID<
O> (O object, {Type? type, dynamic idGetter(O o)?}) → Object? -
Returns the ID value from
object
fortype
. -
getEntityIDFromMap(
Map< Object?, Object?> map, {Type? type}) → Object? -
Returns the ID value into
map
fortype
. -
instantiateAllCachedEntities(
) → int - Instantiate all the entities, calling their entity instantiators. See cacheEntityInstantiator
-
isCachedEntity<
O> (O entity, {Type? type, bool identicalEquality = true}) → bool -
Returns
true
ifentity
is cached. -
isCachedEntityByID<
O> (dynamic id, {Type? type}) → bool -
Returns
true
if an entity oftype
withid
is cached. This includes entities cached through cacheEntity, cacheEntities and cacheEntityInstantiator. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited