public final class

Providers

extends Object
java.lang.Object
   ↳ com.google.inject.util.Providers

Class Overview

Static utility methods for creating and working with instances of Provider.

Summary

Public Methods
static <T> Provider<T> of(T instance)
Returns a provider which always provides instance.
[Expand]
Inherited Methods
From class java.lang.Object

Public Methods

public static Provider<T> of (T instance)

Returns a provider which always provides instance. This should not be necessary to use in your application, but is helpful for several types of unit tests.

Parameters
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.