add injectFields method to InstanceContainer to inject fields for existing instance
This commit is contained in:
parent
92ce01acd0
commit
c3e6826464
|
@ -101,6 +101,11 @@ public abstract class Injector implements InstanceContainer, Binder {
|
|||
return object;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T> T injectFields(T obj) {
|
||||
return injectFields(obj, obj.getClass());
|
||||
}
|
||||
|
||||
public final <T> Binder<T> bind(Class<T> type) {
|
||||
lastType = type;
|
||||
return this;
|
||||
|
|
|
@ -20,5 +20,6 @@ package yugecin.opsudance.core.inject;
|
|||
public interface InstanceContainer {
|
||||
|
||||
<T> T provide(Class<T> type);
|
||||
<T> T injectFields(T instance);
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user