Silk DI 0.6


se.jbee.inject
Class Demand<T>

Object
  extended by 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)

Method Summary
static
<T> Demand<T>
demand(Resource<T> resource, Dependency<? super T> dependency, int serialNumber, int cardinality)
           
 int envCardinality()
           
 int envSerialNumber()
           
 Demand<T> from(Dependency<? super T> dependency)
           
 Dependency<? super T> getDependency()
           
 Resource<T> getResource()
           
 String toString()
           
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

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

Silk DI 0.6