This commit is contained in:
dfsek
2021-11-17 16:28:40 -07:00
parent 172006f2f6
commit 3737e3510d
46 changed files with 133 additions and 152 deletions
@@ -13,6 +13,10 @@ import com.dfsek.terra.api.inject.impl.InjectorImpl;
* @param <T> Type of object to inject.
*/
public interface Injector<T> {
static <T1> Injector<T1> get(T1 value) {
return new InjectorImpl<>(value);
}
/**
* Add an explicit class as a target. Useful for applications where subclasses may cause issues with DI.
*
@@ -38,8 +42,4 @@ public interface Injector<T> {
* </ul>
*/
void inject(Object object) throws InjectionException;
static <T1> Injector<T1> get(T1 value) {
return new InjectorImpl<>(value);
}
}