Silk DI 0.6


se.jbee.inject.config
Class Presets

Object
  extended by se.jbee.inject.config.Presets

public final class Presets
extends Object

Presets are an immutable associative data structure associating a exact Type (including generics) with a value for/of that exact given type. These values act as input parameters to the bootstrapping process. The values are used within modules that depend on data that is given as program input.

Author:
Jan Bernitt (jan@jbee.se)

Field Summary
static Presets EMPTY
           
 
Method Summary
<T> Presets
preset(Class<T> type, T value)
           
<T> Presets
preset(Type<T> type, T value)
           
 String toString()
           
<T> T
value(Type<T> type)
           
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

EMPTY

public static final Presets EMPTY
Method Detail

preset

public <T> Presets preset(Class<T> type,
                          T value)
See Also:
preset(Type, Object)

preset

public <T> Presets preset(Type<T> type,
                          T value)
Returns:
new Presets instance with the given key-value association. Any existing association of the same key will be overridden.

value

public <T> T value(Type<T> type)
Returns:
The value associated with the given exact Type or null of no value is associated with it.

toString

public String toString()
Overrides:
toString in class Object

Silk DI 0.6