// Path: app/src/main/java/io/github/kobakei/anago/entity/Repo.java
// public class Repo {
//     public long id;
//     public String name;
//     public String full_name;
//     public String description;
//     public int stargazers_count;
//     public User owner;
// }
// 
// Path: app/src/main/java/io/github/kobakei/anago/repository/RepoRepository.java
// @Singleton
// public class RepoRepository extends Repository<String, Repo> {
// 
//     private final GitHubApiClient gitHubApiClient;
//     private final AuthTokenDao authTokenDao;
// 
//     @Inject
//     public RepoRepository(GitHubApiClient gitHubApiClient, AuthTokenDao authTokenDao) {
//         super();
//         this.gitHubApiClient = gitHubApiClient;
//         this.authTokenDao = authTokenDao;
//     }
// 
//     public Single<List<Repo>> getPublicRepos(int page, int perPage) {
//         return gitHubApiClient.getPublicRepos(page, perPage);
//     }
// 
//     public Single<List<Repo>> getUserRepos(int page, int perPage) {
//         return authTokenDao.get()
//                 .flatMap(authToken -> {
//                     String header = "token " + authToken.token;
//                     return gitHubApiClient.getUserRepos(header, page, perPage);
//                 })
//                 .doOnSuccess(repos1 -> {
//                     for (Repo repo : repos1) {
//                         getCache().put(repo.full_name, repo);
//                     }
//                 });
//     }
// 
//     public Single<List<Repo>> getStarredRepos(int page, int perPage) {
//         return authTokenDao.get()
//                 .flatMap(authToken -> {
//                     String header = "token " + authToken.token;
//                     return gitHubApiClient.getStarredRepos(header, page, perPage);
//                 })
//                 .doOnSuccess(repos1 -> {
//                     for (Repo repo : repos1) {
//                         getCache().put(repo.full_name, repo);
//                     }
//                 });
//     }
// 
//     public Single<Repo> getByFullname(String user, String repo) {
//         String fullname = user + "/" + repo;
//         if (getCache().containsKey(fullname)) {
//             return Single.just(getCache().get(fullname));
//         }
//         return gitHubApiClient.getRepo(user, repo);
//     }
// }


import javax.inject.Inject;
import io.github.kobakei.anago.entity.Repo;
import io.github.kobakei.anago.repository.RepoRepository;
import rx.Single;
package io.github.kobakei.anago.usecase;



/**
 * リポジトリ情報を取得するユースケース
 * Created by keisuke on 2016/09/18.
 */

public class GetRepoUseCase {

    private final RepoRepository repoRepository;

    @Inject
// Path: app/src/main/java/io/github/kobakei/anago/entity/Repo.java
// public class Repo {
//     public long id;
//     public String name;
//     public String full_name;
//     public String description;
//     public int stargazers_count;
//     public User owner;
// }
// 
// Path: app/src/main/java/io/github/kobakei/anago/repository/RepoRepository.java
// @Singleton
// public class RepoRepository extends Repository<String, Repo> {
// 
//     private final GitHubApiClient gitHubApiClient;
//     private final AuthTokenDao authTokenDao;
// 
//     @Inject
//     public RepoRepository(GitHubApiClient gitHubApiClient, AuthTokenDao authTokenDao) {
//         super();
//         this.gitHubApiClient = gitHubApiClient;
//         this.authTokenDao = authTokenDao;
//     }
// 
//     public Single<List<Repo>> getPublicRepos(int page, int perPage) {
//         return gitHubApiClient.getPublicRepos(page, perPage);
//     }
// 
//     public Single<List<Repo>> getUserRepos(int page, int perPage) {
//         return authTokenDao.get()
//                 .flatMap(authToken -> {
//                     String header = "token " + authToken.token;
//                     return gitHubApiClient.getUserRepos(header, page, perPage);
//                 })
//                 .doOnSuccess(repos1 -> {
//                     for (Repo repo : repos1) {
//                         getCache().put(repo.full_name, repo);
//                     }
//                 });
//     }
// 
//     public Single<List<Repo>> getStarredRepos(int page, int perPage) {
//         return authTokenDao.get()
//                 .flatMap(authToken -> {
//                     String header = "token " + authToken.token;
//                     return gitHubApiClient.getStarredRepos(header, page, perPage);
//                 })
//                 .doOnSuccess(repos1 -> {
//                     for (Repo repo : repos1) {
//                         getCache().put(repo.full_name, repo);
//                     }
//                 });
//     }
// 
//     public Single<Repo> getByFullname(String user, String repo) {
//         String fullname = user + "/" + repo;
//         if (getCache().containsKey(fullname)) {
//             return Single.just(getCache().get(fullname));
//         }
//         return gitHubApiClient.getRepo(user, repo);
//     }
// }


// Path: app/src/main/java/io/github/kobakei/anago/usecase/GetRepoUseCase.java
import javax.inject.Inject;
import io.github.kobakei.anago.entity.Repo;
import io.github.kobakei.anago.repository.RepoRepository;
import rx.Single;

package io.github.kobakei.anago.usecase;



/**
 * リポジトリ情報を取得するユースケース
 * Created by keisuke on 2016/09/18.
 */

public class GetRepoUseCase {

    private final RepoRepository repoRepository;

    @Inject
    public GetRepoUseCase(RepoRepository repoRepository) {