Created
November 10, 2017 14:24
-
-
Save sajadshokri/2b6b2c9973ee3f9001fe3564b8e0f387 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static <T> T using(Class<T> aClass) { | |
if (!aClass.isInterface()) { | |
throw new IllegalArgumentException("API declarations must be interfaces."); | |
} | |
if (repository == null) { | |
repository = new NetworkRepo(); | |
} | |
return repository.getRetrofit().create(aClass); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment