override<T> method

void override<T>(
  1. T key,
  2. Constructable<T> clazz
)

Implementation

void override<T>(T key, Constructable<T> clazz) {
  if (!_services.containsKey(key)) {
    throw Exception('Service not exists, you can\t override it');
  }

  _services[key as Type] = clazz();
}