removeAlias abstract method

void removeAlias(
  1. String alias
)

Removes an alias from the registry.

Removes the specified alias from the registry, making it no longer valid for accessing the associated object. This does not affect the primary name or the object itself.

Parameters:

  • alias: The alias to remove from the registry

Throws:

  • InvalidArgumentException if alias is not registered as an alias

Example:

final registry = MyAliasRegistry();
registry.registerAlias('logService', 'logger');

// Alias is active
print(registry.isAlias('logger')); // true

// Remove the alias
registry.removeAlias('logger');

// Alias is no longer active
print(registry.isAlias('logger')); // false

// Primary name remains unaffected
final service = registry.get('logService'); // Still works

Implementation

void removeAlias(String alias);