Dependency<T extends Object> class final

Represents a dependency stored within DIRegistry. Dependencies are wrappers around values with additional DependencyMetadata to manage their lifecycle.

Constructors

Dependency(Resolvable<T> _value, {Option<DependencyMetadata> metadata = const None()})

Properties

hashCode int
The hash code for this object.
no setteroverride
metadata Option<DependencyMetadata>
The metadata associated with this Dependency.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
typeEntity Entity
The registry key for this dependency: returns DependencyMetadata.preemptivetypeEntity if one was supplied, otherwise the runtime type of the wrapped value.
no setter
value Resolvable<T>
The value contained within this Dependency.
no setter

Methods

copyWith({Option<Resolvable<T>> value = const None(), Option<DependencyMetadata> metadata = const None()}) Dependency<T>
Creates a new instance with updated fields, preserving the values of any fields not explicitly specified.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
passNewValue<R extends Object>(Resolvable<R> newValue) Dependency<R>
Creates a new Dependency instance with a different value of type R, while retaining the existing metadata.
toString() String
A string representation of this object.
inherited
transf<R extends Object>() Dependency<R>
Returns a new Dependency instance where the current _value is cast to type R, while retaining the existing metadata.

Operators

operator ==(Object other) bool
Equality is hash-based by design — consistent with Entity / TypeEntity elsewhere in the package. Used only to skip no-op setDependency overwrites in DIRegistry (and so to avoid spurious onChange callbacks); the registry slot key is typeEntity, not the dep itself, so a hash collision here cannot misroute a lookup.
override