newDefaultCache<T extends CacheStore> function
Cache
newDefaultCache<T extends CacheStore>(})
Creates a new DefaultCache
bound to an implementation of the CacheStore
interface
store
: The store implementationname
: The name of the cacheexpiryPolicy
: The expiry policy to usesampler
: The sampler to use upon eviction of a cache elementevictionPolicy
: The eviction policy to usemaxEntries
: The max number of entries this cache can hold if provided.cacheLoader
: TheCacheLoader
, that should be used to fetch a new value upon expirationclock
: The source of time to be usedeventListenerMode
: The event listener mode of this cache
Implementation
Cache newDefaultCache<T extends CacheStore>(T store,
{String? name,
ExpiryPolicy? expiryPolicy,
KeySampler? sampler,
EvictionPolicy? evictionPolicy,
int? maxEntries,
CacheLoader? cacheLoader,
Clock? clock,
EventListenerMode? eventListenerMode}) {
return Cache.newCache(store,
name: name,
expiryPolicy: expiryPolicy,
sampler: sampler,
evictionPolicy: evictionPolicy,
maxEntries: maxEntries,
cacheLoader: cacheLoader,
clock: clock,
eventListenerMode: eventListenerMode);
}