se.jbee.inject
Class Demand<T>
Object
se.jbee.inject.Demand<T>
- Type Parameters:
T - Type of the value demanded
- All Implemented Interfaces:
- Resourced<T>
public final class Demand<T>
- extends Object
- implements Resourced<T>
A Demand is a Dependency resolved to a specific Resource in the context
of a specific Injector (the Repository within it).
- Author:
- Jan Bernitt (jan@jbee.se)
| Methods inherited from class Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
demand
public static <T> Demand<T> demand(Resource<T> resource,
Dependency<? super T> dependency,
int serialNumber,
int cardinality)
getDependency
public Dependency<? super T> getDependency()
getResource
public Resource<T> getResource()
- Specified by:
getResource in interface Resourced<T>
- Returns:
- The
Resource of this compound.
envSerialNumber
public final int envSerialNumber()
- Returns:
- the number of the
Injectron being injected.
envCardinality
public final int envCardinality()
- Returns:
- the total amount of
Injectrons in the same environment (Injector).
from
public Demand<T> from(Dependency<? super T> dependency)
toString
public String toString()
- Overrides:
toString in class Object