// Path: app/src/main/java/com/photoviewer/domain/Photo.java
// @Accessors(prefix = "m")
// public class Photo {
// 
//     @Getter
//     @Setter
//     private int mId;
// 
//     @Getter
//     @Setter
//     private String mTitle;
// 
//     @Getter
//     @Setter
//     private String mUrl;
// 
//     @Getter
//     @Setter
//     private String mThumbnailUrl;
// }
// 
// Path: app/src/main/java/com/photoviewer/domain/usecases/GetPhotoDetails.java
// @Accessors(prefix = "m") public class GetPhotoDetails extends UseCase<Photo> {
// 
//   @Setter private int mPhotoId;
//   private final PhotoEntityToPhoto mPhotoTransformer;
// 
//   private PhotoEntityDataSource mPhotoEntityDataSource;
// 
//   @Inject public GetPhotoDetails(@Named(RxModule.COMPUTATION) Scheduler executionScheduler,
//       @Named(RxModule.MAIN_THREAD) Scheduler observingScheduler,
//       PhotoEntityDataSource photoEntityDataSource) {
//     super(executionScheduler, observingScheduler);
//     mPhotoTransformer = new PhotoEntityToPhoto();
//     mPhotoEntityDataSource = photoEntityDataSource;
//   }
// 
//   @Override protected Observable<Photo> call() {
//     return this.mPhotoEntityDataSource.photo(mPhotoId).map(mPhotoTransformer::transform);
//   }
// }
// 
// Path: app/src/main/java/com/photoviewer/domain/usecases/SimpleSubscriber.java
// public class SimpleSubscriber<T> extends rx.Subscriber<T> {
//     @Override
//     public void onCompleted() {
//         // no-op by default.
//     }
// 
//     @Override
//     public void onError(Throwable e) {
//         // no-op by default.
//     }
// 
//     @Override
//     public void onNext(T t) {
//         // no-op by default.
//     }
// }
// 
// Path: app/src/main/java/com/photoviewer/presentation/mapper/photo/PhotoToPhotoModel.java
// public class PhotoToPhotoModel extends BaseLayerDataTransformer<Photo, PhotoModel> {
//     @Override
//     public PhotoModel transform(Photo from) {
//         PhotoModel transformed = new PhotoModel();
// 
//         transformed.setId(from.getId());
//         transformed.setTitle(from.getTitle());
//         transformed.setUrl(from.getUrl());
//         transformed.setThumbnailUrl(from.getThumbnailUrl());
// 
//         return transformed;
//     }
// }
// 
// Path: app/src/main/java/com/photoviewer/presentation/model/PhotoModel.java
// @Accessors(prefix = "m")
// public class PhotoModel {
// 
//     @Getter
//     @Setter
//     private int mId;
// 
//     @Getter
//     @Setter
//     private String mTitle;
// 
//     @Getter
//     @Setter
//     private String mUrl;
// 
//     @Getter
//     @Setter
//     private String mThumbnailUrl;
// }
// 
// Path: app/src/main/java/com/photoviewer/presentation/view/PhotoDetailsView.java
// public interface PhotoDetailsView extends LoadDataView {
//   /**
//    * Render a photo in the UI.
//    *
//    * @param photo The {@link PhotoModel} that will be shown.
//    */
//   void renderPhoto(PhotoModel photo);
// }


import android.support.annotation.NonNull;
import com.photoviewer.domain.Photo;
import com.photoviewer.domain.usecases.GetPhotoDetails;
import com.photoviewer.domain.usecases.SimpleSubscriber;
import com.photoviewer.presentation.mapper.photo.PhotoToPhotoModel;
import com.photoviewer.presentation.model.PhotoModel;
import com.photoviewer.presentation.view.PhotoDetailsView;
import javax.inject.Inject;
    }

    private void hideViewLoading() {
        mViewDetailsView.hideLoading();
    }

    private void showViewRetry() {
        mViewDetailsView.showRetry();
    }

    private void hideViewRetry() {
        mViewDetailsView.hideRetry();
    }

    private void showErrorMessage() {
        //TODO implement
        String errorMessage = "Error happened";
        mViewDetailsView.showError(errorMessage);
    }

    private void showPhotoDetailsInView(Photo photo) {
        final PhotoModel photoModel = mPhotoModelTransformer.transform(photo);
        mViewDetailsView.renderPhoto(photoModel);
    }

    private void getPhotoDetails() {
        mGetPhotoDetailsUseCase.setPhotoId(mPhotoId);
        mGetPhotoDetailsUseCase.execute(new PhotoDetailsSubscriber());
    }

// Path: app/src/main/java/com/photoviewer/domain/Photo.java
// @Accessors(prefix = "m")
// public class Photo {
// 
//     @Getter
//     @Setter
//     private int mId;
// 
//     @Getter
//     @Setter
//     private String mTitle;
// 
//     @Getter
//     @Setter
//     private String mUrl;
// 
//     @Getter
//     @Setter
//     private String mThumbnailUrl;
// }
// 
// Path: app/src/main/java/com/photoviewer/domain/usecases/GetPhotoDetails.java
// @Accessors(prefix = "m") public class GetPhotoDetails extends UseCase<Photo> {
// 
//   @Setter private int mPhotoId;
//   private final PhotoEntityToPhoto mPhotoTransformer;
// 
//   private PhotoEntityDataSource mPhotoEntityDataSource;
// 
//   @Inject public GetPhotoDetails(@Named(RxModule.COMPUTATION) Scheduler executionScheduler,
//       @Named(RxModule.MAIN_THREAD) Scheduler observingScheduler,
//       PhotoEntityDataSource photoEntityDataSource) {
//     super(executionScheduler, observingScheduler);
//     mPhotoTransformer = new PhotoEntityToPhoto();
//     mPhotoEntityDataSource = photoEntityDataSource;
//   }
// 
//   @Override protected Observable<Photo> call() {
//     return this.mPhotoEntityDataSource.photo(mPhotoId).map(mPhotoTransformer::transform);
//   }
// }
// 
// Path: app/src/main/java/com/photoviewer/domain/usecases/SimpleSubscriber.java
// public class SimpleSubscriber<T> extends rx.Subscriber<T> {
//     @Override
//     public void onCompleted() {
//         // no-op by default.
//     }
// 
//     @Override
//     public void onError(Throwable e) {
//         // no-op by default.
//     }
// 
//     @Override
//     public void onNext(T t) {
//         // no-op by default.
//     }
// }
// 
// Path: app/src/main/java/com/photoviewer/presentation/mapper/photo/PhotoToPhotoModel.java
// public class PhotoToPhotoModel extends BaseLayerDataTransformer<Photo, PhotoModel> {
//     @Override
//     public PhotoModel transform(Photo from) {
//         PhotoModel transformed = new PhotoModel();
// 
//         transformed.setId(from.getId());
//         transformed.setTitle(from.getTitle());
//         transformed.setUrl(from.getUrl());
//         transformed.setThumbnailUrl(from.getThumbnailUrl());
// 
//         return transformed;
//     }
// }
// 
// Path: app/src/main/java/com/photoviewer/presentation/model/PhotoModel.java
// @Accessors(prefix = "m")
// public class PhotoModel {
// 
//     @Getter
//     @Setter
//     private int mId;
// 
//     @Getter
//     @Setter
//     private String mTitle;
// 
//     @Getter
//     @Setter
//     private String mUrl;
// 
//     @Getter
//     @Setter
//     private String mThumbnailUrl;
// }
// 
// Path: app/src/main/java/com/photoviewer/presentation/view/PhotoDetailsView.java
// public interface PhotoDetailsView extends LoadDataView {
//   /**
//    * Render a photo in the UI.
//    *
//    * @param photo The {@link PhotoModel} that will be shown.
//    */
//   void renderPhoto(PhotoModel photo);
// }


// Path: app/src/main/java/com/photoviewer/presentation/presenter/PhotoDetailsPresenter.java
import android.support.annotation.NonNull;
import com.photoviewer.domain.Photo;
import com.photoviewer.domain.usecases.GetPhotoDetails;
import com.photoviewer.domain.usecases.SimpleSubscriber;
import com.photoviewer.presentation.mapper.photo.PhotoToPhotoModel;
import com.photoviewer.presentation.model.PhotoModel;
import com.photoviewer.presentation.view.PhotoDetailsView;
import javax.inject.Inject;

    }

    private void hideViewLoading() {
        mViewDetailsView.hideLoading();
    }

    private void showViewRetry() {
        mViewDetailsView.showRetry();
    }

    private void hideViewRetry() {
        mViewDetailsView.hideRetry();
    }

    private void showErrorMessage() {
        //TODO implement
        String errorMessage = "Error happened";
        mViewDetailsView.showError(errorMessage);
    }

    private void showPhotoDetailsInView(Photo photo) {
        final PhotoModel photoModel = mPhotoModelTransformer.transform(photo);
        mViewDetailsView.renderPhoto(photoModel);
    }

    private void getPhotoDetails() {
        mGetPhotoDetailsUseCase.setPhotoId(mPhotoId);
        mGetPhotoDetailsUseCase.execute(new PhotoDetailsSubscriber());
    }

    private final class PhotoDetailsSubscriber extends SimpleSubscriber<Photo> {