Modifier and Type | Method and Description |
---|---|
static <T> Provider<T> |
guicify(Provider<T> provider)
Returns a Guice-friendly
com.google.inject.Provider for the given
JSR-330 javax.inject.Provider . |
static <T> Provider<T> |
of(T instance)
Returns a provider which always provides
instance . |
public static <T> Provider<T> of(T instance)
instance
. This should not
be necessary to use in your application, but is helpful for several types
of unit tests.instance
- the instance that should always be provided. This is also
permitted to be null, to enable aggressive testing, although in real
life a Guice-supplied Provider will never return null.