newEntry method

  1. @override
CacheEntry newEntry(
  1. int seed, {
  2. String? key,
  3. Duration? expiryDuration,
  4. DateTime? creationTime,
})
override

Creates a new CacheEntry with the provided ValueGenerator and seed

  • seed: The seed for the ValueGenerator
  • key: The cache key
  • expiryDuration: The cache expiry duration
  • creationTime: The cache creation time

Returns a fully initialized CacheEntry

Implementation

@override
CacheEntry newEntry(int seed,
    {String? key, Duration? expiryDuration, DateTime? creationTime}) {
  return CacheEntryBuilder(
    key ?? 'cache_key_$seed',
    generator.nextValue(seed),
    creationTime ?? DateTime.now(),
    expiryDuration ?? seed.minutes,
  ).build();
}