newCache method
Cache
newCache(
- T store, {
- String? name,
- ExpiryPolicy? expiryPolicy,
- KeySampler? sampler,
- EvictionPolicy? evictionPolicy,
- int? maxEntries,
- CacheLoader? cacheLoader,
- Clock? clock,
Creates a new cache
store: The CacheStorename: 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: The CacheLoader, that should be used to fetch a new value upon expirationclock: The source of time to be used on this
Implementation
Cache newCache(T store,
{String? name,
ExpiryPolicy? expiryPolicy,
KeySampler? sampler,
EvictionPolicy? evictionPolicy,
int? maxEntries,
CacheLoader? cacheLoader,
Clock? clock}) {
return newDefaultCache(store,
name: name,
expiryPolicy: expiryPolicy,
sampler: sampler,
evictionPolicy: evictionPolicy,
maxEntries: maxEntries,
cacheLoader: cacheLoader,
clock: clock);
}