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