Package com.batch.android.di
Class DI
- java.lang.Object
-
- com.batch.android.di.DI
-
public final class DI extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description protected java.util.Map<java.lang.Class<?>,java.lang.Object>singletonInstances
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description <T> voidaddSingletonInstance(java.lang.Class<T> key, T instance)Return the instance of a singleton if it exists, null otherwisestatic DIgetInstance()<T> TgetSingletonInstance(java.lang.Class<T> key)Return the instance of a singleton if it exists, null otherwisestatic voidreset()
-
-
-
Method Detail
-
getInstance
public static DI getInstance()
-
reset
public static void reset()
-
getSingletonInstance
@Nullable public <T> T getSingletonInstance(java.lang.Class<T> key)
Return the instance of a singleton if it exists, null otherwise- Type Parameters:
T-- Parameters:
key-- Returns:
-
addSingletonInstance
@Nullable public <T> void addSingletonInstance(java.lang.Class<T> key, T instance)Return the instance of a singleton if it exists, null otherwise- Type Parameters:
T-- Parameters:
key-
-
-