has abstract method

Future<bool> has(
  1. String key
)

Checks if a key exists in the cache and has not expired.

Returns true if the key is present in the cache and its TTL has not expired, otherwise returns false.

Throws an exception if the key is null or empty.

  • Parameters:
    • key: A non-null, non-empty string representing the cache key.
  • Returns: true if the key exists and is valid, false otherwise.

Implementation

Future<bool> has(String key);