ValueFactory<T extends Object> class

A CobaltFactory that always returns the same value.

Unlike registerSingleton, this keeps the registration lazy — the value is handed out on first resolution, so a test can assert that nothing resolved it at all.

Constructors

ValueFactory(T value)
Creates a factory returning value.
const

Properties

hashCode → int
The hash code for this object.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
value → T
What every resolution returns.
final

Methods

create(CobaltResolver resolver) → T
Builds a new T, resolving its dependencies from resolver.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited