set abstract method

void set(
  1. String key,
  2. CacheEntry entry
)

Stores a cache entry with the given key.

If an entry with the same key already exists, it should be replaced.

Implementations may enforce size limits and evict old entries as needed (e.g., LRU eviction).

Implementation

void set(String key, CacheEntry entry);