JsonEntityCache class abstract

A JSON entity encoding/decoding cache.

Implementers

Constructors

JsonEntityCache.new()

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 with ids.
getCachedEntityByID<O>(dynamic id, {Type? type}) → O?
Returns a cached entity of type with id.
getCachedEntityByMapID<O>(Map<Object?, Object?> map, {Type? type}) → O?
Returns a cached entity of type with an id from map entries. See getEntityIDFromMap.
getEntityID<O>(O object, {Type? type, dynamic idGetter(O o)?}) Object?
Returns the ID value from object for type.
getEntityIDFromMap(Map<Object?, Object?> map, {Type? type}) Object?
Returns the ID value into map for type.
instantiateAllCachedEntities() int
Instantiate all the entities, calling their entity instantiators. See cacheEntityInstantiator
isCachedEntity<O>(O entity, {Type? type, bool identicalEquality = true}) bool
Returns true if entity is cached.
isCachedEntityByID<O>(dynamic id, {Type? type}) bool
Returns true if an entity of type with id 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