CacheStat constructor Null safety

CacheStat(
  1. String key,
  2. DateTime expiryTime,
  3. DateTime creationTime,
  4. {DateTime? accessTime,
  5. DateTime? updateTime,
  6. int? hitCount}
)

Builds a CacheStat

  • key: The cache key
  • expiryTime: The cache expiry time
  • creationTime: The cache creation time
  • accessTime: The cache access time
  • updateTime: The cache update time
  • hitCount: The cache hit count

Implementation

CacheStat(this.key, this.expiryTime, this.creationTime,
    {DateTime? accessTime, DateTime? updateTime, int? hitCount})
    : assert(key.isNotEmpty),
      assert(hitCount == null || hitCount >= 0),
      accessTime = accessTime ?? creationTime,
      updateTime = updateTime ?? creationTime,
      hitCount = hitCount ?? 0;