# ObjectHolder<T> constructor

ObjectHolder<T>(

1. T _value, {
2. String? packageName,
3. String? qualifiedName,

})

A generic container that holds an object along with optional metadata such as its package name and qualified name.

The ObjectHolder is useful for cases where you want to associate an object with extra metadata that describes where it came from (e.g., reflection, classpath scanning, or dependency resolution).

- `T` is the type of object being held.
- `_packageName` represents the Dart package in which the object resides.
- `_qualifiedName` represents the fully qualified class or type name.

### Example

    void main() {
      final holder = ObjectHolder<String>(
        'MyClass',
        packageName: 'my_app',
        qualifiedName: 'package:my_app/my_app.dart.MyClass',
      );

      print('Value: ${holder.getValue()}');
      print('Package: ${holder.getPackageName()}');
      print('Qualified name: ${holder.getQualifiedName()}');
    }

Constraints:

- Either `packageName` or `qualifiedName` must be provided.
- If provided, neither may be an empty string.

Creates a new ObjectHolder wrapping a value of type `T`.

Throws an IllegalArgumentException if:

- Both `packageName` and `qualifiedName` are `null`.
- Either `packageName` or `qualifiedName` are provided but empty.

### Example

    final holder = ObjectHolder<int>(
      42,
      packageName: 'core',
      qualifiedName: 'core.constants.Answer',
    );
    print(holder.getValue()); // 42

## Implementation

    ObjectHolder(this._value, {String? packageName, String? qualifiedName}) : _packageName = packageName, _qualifiedName = qualifiedName {
      if(packageName == null && qualifiedName == null) {
        throw IllegalArgumentException('Package name or qualified name must be provided');
      }

      if(packageName != null && packageName.isEmpty) {
        throw IllegalArgumentException('Package name must not be empty');
      }

      if(qualifiedName != null && qualifiedName.isEmpty) {
        throw IllegalArgumentException('Qualified name must not be empty');
      }
    }