add method

void add(
  1. dynamic cache
)

Add a new cache to manage

Implementation

void add(dynamic cache) {
  if (cache is CacheIt) {
    if (_cacheMap.containsKey(cache.id)) {
      // should not happen
      throw const DuplicateEntryException();
    } else {
      _cacheMap[cache.id] = cache;
    }
  } else {
    throw const TypeException();
  }
}