isLoaded abstract method

bool isLoaded(
  1. String className
)

Checks if a class is already loaded in the cache.

Parameters:

  • className: The fully qualified class name to check

Returns:

  • true if the class is currently cached
  • false if the class needs to be loaded

Use Cases

  • Avoiding unnecessary loading operations
  • Cache hit rate monitoring
  • Conditional loading strategies

Example

if (!loader.isLoaded('com.example.User')) {
  print('Loading User class for first time...');
  await loader.loadClass<User>('com.example.User');
}

Performance

  • O(1) lookup operation
  • No I/O or reflection overhead
  • Safe for frequent checking

Implementation

bool isLoaded(String className);