cz.cuni.amis.pogamut.base.utils.guice
Class AdaptableProvider<T>

java.lang.Object
  extended by cz.cuni.amis.pogamut.base.utils.guice.AdaptableProvider<T>
Type Parameters:
T -
All Implemented Interfaces:
com.google.inject.Provider<T>

public class AdaptableProvider<T>
extends java.lang.Object
implements com.google.inject.Provider<T>

Simple implementation of the Guice Provider interface that allows you to set the value directly into the provider via set(Object).

This class is meant to be used by agent factories that has to preconfigure some providers before they can instantiate a new agent.


Constructor Summary
AdaptableProvider()
          Creates a provider with 'null' initial value.
AdaptableProvider(T initialProvidedValue)
          Creates a provider with initial value.
 
Method Summary
 T get()
           
 void set(T value)
          Sets the provided value to 'value'.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AdaptableProvider

public AdaptableProvider()
Creates a provider with 'null' initial value.


AdaptableProvider

public AdaptableProvider(T initialProvidedValue)
Creates a provider with initial value.

Parameters:
initialProvidedValue -
Method Detail

set

public void set(T value)
Sets the provided value to 'value'.

Parameters:
value -

get

public T get()
Specified by:
get in interface com.google.inject.Provider<T>