Skip to content

Instantly share code, notes, and snippets.

@sajadshokri
Created November 10, 2017 14:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sajadshokri/2b6b2c9973ee3f9001fe3564b8e0f387 to your computer and use it in GitHub Desktop.
Save sajadshokri/2b6b2c9973ee3f9001fe3564b8e0f387 to your computer and use it in GitHub Desktop.
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