AsyncCacheFriendDelegate<D extends Object, P extends CacheFriend> class
Wraps delegate adding unmodified CacheFriend.cacheKey to the mix with data.
Validates that key on get and returns null if it is not equals original.
Helps to make sure the data returned is not a result of clashed cache key.
- Implemented types
-
- AsyncCacheDelegate<
D, P>
- AsyncCacheDelegate<
- Available extensions
Constructors
-
AsyncCacheFriendDelegate(AsyncCacheDelegate<
DataWithCacheKey< delegate)D> , P> -
Constructor
delegateCache delegateconst
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
delete(
P params) → Future< void> -
Deletes cached value
paramsCaching keyoverride -
get(
P params) → Future< Entity< D> ?> -
Returns data if cached
paramsCaching keyoverride -
invalidate(
P params) → Future< void> -
Invalidates cached value
paramsCaching keyoverride -
invalidateAll(
) → Future< void> -
Invalidates all cached values
override
-
makeFriendParams<
P extends Object> (String stringify(P params)) → AsyncCacheDelegate< D, P> -
Available on AsyncCacheDelegate<
Creates an adapter delegate that creates CacheFriend params usingD, CacheFriend> , provided by the AsyncCacheFriendExtension extensionstringifyfunction Receiver - Delegate with CacheFriend params e.g. the one that saves data to files and uses params as file names -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
save(
P params, Entity< D> entity) → Future<void> -
Saves data to cache
paramsCaching keyentityEntity to cacheoverride -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited