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

Package class diagram package AdaptableProvider
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 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.

Author:
Jimmy

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>


Copyright © 2013 AMIS research group, Faculty of Mathematics and Physics, Charles University in Prague, Czech Republic. All Rights Reserved.