MCPcopy Create free account
hub / github.com/google/guice / of

Method of

core/src/com/google/inject/util/Providers.java:52–54  ·  view source on GitHub ↗

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. @param instance the instance that should always be provided. This is also permitted to be null, to enable aggressive testing, altho

(final T instance)

Source from the content-addressed store, hash-verified

50 * return null.
51 */
52 public static <T> Provider<T> of(final T instance) {
53 return new ConstantProvider<T>(instance);
54 }
55
56 private static final class ConstantProvider<T> implements Provider<T> {
57 private final T instance;

Callers 15

configureMethod · 0.95
InjectableClass · 0.95
testMixedTargetsFailsMethod · 0.95
configureMethod · 0.95
configureMethod · 0.95
configureMethod · 0.95
configureMethod · 0.95
configureMethod · 0.95
visitMethod · 0.95
configureMethod · 0.95
configureMethod · 0.95

Calls

no outgoing calls

Tested by 15

configureMethod · 0.76
testMixedTargetsFailsMethod · 0.76
configureMethod · 0.76
configureMethod · 0.76
configureMethod · 0.76
configureMethod · 0.76
configureMethod · 0.76
visitMethod · 0.76
configureMethod · 0.76
configureMethod · 0.76
configureMethod · 0.76
configureMethod · 0.76