public class InstanceProvider<T> extends StdProvider<T> implements Provider<T>
public class Foo {
private final String name;
// ...
}
The binding:
bind(Foo.class).toInstance(new Foo());
should work
The bound instances are not injected
injected| Constructor and Description |
|---|
InstanceProvider(T instance) |
| Modifier and Type | Method and Description |
|---|---|
T |
get() |
java.lang.String |
toString() |
Provider<T> |
withScope(Key<?> match,
Scope scope)
Adds the control of scoping the provider.
|
get, inject, isInjected, onBind, setInjectedpublic InstanceProvider(T instance)
public Provider<T> withScope(Key<?> match, Scope scope)
StdProvider
Scopes the provider with the given scope
withScope in class StdProvider<T>match - The key used to match the scopescope - The scope to applypublic T get()
public java.lang.String toString()
toString in class java.lang.Object