// Path: app/src/main/java/com/tonilopezmr/sample/domain/interactor/DeleteSubjectUseCaseImp.java
// public class DeleteSubjectUseCaseImp extends AbstractSubjectUseCase implements SubjectUseCase {
// 
//     private Callback callback;
//     private Subject subject;
// 
//     public DeleteSubjectUseCaseImp(Executor executor, MainThread mainThread, SubjectRepository subjectRepository) {
//         super(executor, mainThread, subjectRepository);
//     }
// 
//     @Override
//     public void execute(Subject subject, final Callback callback) {
//         if (callback == null){
//             throw new IllegalArgumentException("Callback parameter can't be null");
//         }
// 
//         this.callback = callback;
//         this.subject = subject;
//         super.executor.run(this);
//     }
// 
// 
//     //Interactor Use case
//     @Override
//     public void run() {
//         super.subjectRepository.deleteSubject(subject, new SubjectRepository.SubjectUseCase() {
//             @Override
//             public void onMissionAccomplished(final Subject subject) {
//                 DeleteSubjectUseCaseImp.super.mainThread.post(new Runnable() {
//                     @Override
//                     public void run() {
//                         callback.onMissionAccomplished(subject);
//                     }
//                 });
//             }
// 
//             @Override
//             public void onError(final SubjectException subjectException) {
//                 DeleteSubjectUseCaseImp.super.mainThread.post(new Runnable() {
//                     @Override
//                     public void run() {
//                         callback.onError(subjectException);
//                     }
//                 });
//             }
//         });
//     }
// }
// 
// Path: app/src/main/java/com/tonilopezmr/sample/domain/interactor/SubjectUseCase.java
// public interface SubjectUseCase extends Interactor {
// 
//     interface Callback {
//         void onMissionAccomplished(Subject subject);
//         void onError(SubjectException ex);
//     }
// 
//     public void execute(Subject subject, final Callback callback);
// }
// 
// Path: app/src/main/java/com/tonilopezmr/sample/domain/interactor/CreateSubjectUseCaseImp.java
// public class CreateSubjectUseCaseImp extends AbstractSubjectUseCase implements SubjectUseCase {
// 
//     private Callback callback;
//     private Subject subject;
// 
//     public CreateSubjectUseCaseImp(Executor executor, MainThread mainThread, SubjectRepository subjectRepository) {
//         super(executor, mainThread, subjectRepository);
//     }
// 
//     @Override
//     public void execute(Subject subject, final Callback callback) {
//         if (callback == null){
//             throw new IllegalArgumentException("Callback parameter can't be null");
//         }
// 
//         this.callback = callback;
//         this.subject = subject;
//         super.executor.run(this);
//     }
// 
// 
//     //Interactor Use case
//     @Override
//     public void run() {
//         try {
//             Thread.sleep(1000);
//         } catch (InterruptedException e) {
//             e.printStackTrace();
//         }
// 
//         super.subjectRepository.createSubject(this.subject, new SubjectRepository.SubjectUseCase() {
//             @Override
//             public void onMissionAccomplished(final Subject subject) {
//                 CreateSubjectUseCaseImp.super.mainThread.post(new Runnable() {
//                     @Override
//                     public void run() {
//                         callback.onMissionAccomplished(subject);
//                     }
//                 });
//             }
// 
//             @Override
//             public void onError(final SubjectException subjectException) {
//                 CreateSubjectUseCaseImp.super.mainThread.post(new Runnable() {
//                     @Override
//                     public void run() {
//                         callback.onError(subjectException);
//                     }
//                 });
//             }
//         });
//     }
// }
// 
// Path: app/src/main/java/com/tonilopezmr/sample/domain/interactor/GetSubjectListUseCase.java
// public interface GetSubjectListUseCase extends Interactor {
// 
//     interface Callback{
//         void onSubjectListLoaded(Collection<Subject> subjects);
//         void onError(SubjectException exception);
//     }
// 
//     public void execute(final Callback callback);
// }
// 
// Path: app/src/main/java/com/tonilopezmr/sample/domain/repository/SubjectRepository.java
// public interface SubjectRepository {
// 
//     interface SubjectListCallback {
//         void onSubjectListLoader(Collection<Subject> subjects);
//         void onError(SubjectException subjectException);
//     }
// 
//     interface SubjectUseCase {
//         void onMissionAccomplished(Subject subject);
//         void onError(SubjectException subjectException);
//     }
// 
//     void getSubjectsCollection(SubjectListCallback callback) throws SubjectException;
// 
//     void createSubject(Subject subject, SubjectUseCase callback) throws SubjectException;
//     void deleteSubject(Subject subject, SubjectUseCase callback) throws  SubjectException;
// }
// 
// Path: app/src/main/java/com/tonilopezmr/sample/executor/Executor.java
// public interface Executor {
//     void run(final Interactor interactor);
// }
// 
// Path: app/src/main/java/com/tonilopezmr/sample/executor/MainThread.java
// public interface MainThread {
//     void post(final Runnable runnable);
// }


import com.tonilopezmr.sample.domain.interactor.DeleteSubjectUseCaseImp;
import com.tonilopezmr.sample.domain.interactor.SubjectUseCase;
import com.tonilopezmr.sample.domain.interactor.CreateSubjectUseCaseImp;
import com.tonilopezmr.sample.domain.interactor.GetSubjectListUseCase;
import com.tonilopezmr.sample.domain.interactor.GetSubjectListUseCaseImp;
import com.tonilopezmr.sample.domain.repository.SubjectRepository;
import com.tonilopezmr.sample.executor.Executor;
import com.tonilopezmr.sample.executor.MainThread;
import javax.inject.Named;
import dagger.Module;
import dagger.Provides;
package com.tonilopezmr.sample.di.modules;




/**
 *
 * @author Toni
 */
@Module(
        complete = false,
        library = true
)
public final class InteractorModule {

    @Named("delete usecase")
    @Provides
    public SubjectUseCase provideDeleteSubjectUseCase(Executor executor, MainThread mainThread, @Named("internal_database")SubjectRepository subjectRepository){
        return new DeleteSubjectUseCaseImp(executor, mainThread, subjectRepository);
    }

    @Named("create usecase")
    @Provides
    public SubjectUseCase provideCreateSubjectUseCase(Executor executor, MainThread mainThread, @Named("internal_database")SubjectRepository subjectRepository){
        return new CreateSubjectUseCaseImp(executor, mainThread, subjectRepository);
    }

    @Provides
// Path: app/src/main/java/com/tonilopezmr/sample/domain/interactor/DeleteSubjectUseCaseImp.java
// public class DeleteSubjectUseCaseImp extends AbstractSubjectUseCase implements SubjectUseCase {
// 
//     private Callback callback;
//     private Subject subject;
// 
//     public DeleteSubjectUseCaseImp(Executor executor, MainThread mainThread, SubjectRepository subjectRepository) {
//         super(executor, mainThread, subjectRepository);
//     }
// 
//     @Override
//     public void execute(Subject subject, final Callback callback) {
//         if (callback == null){
//             throw new IllegalArgumentException("Callback parameter can't be null");
//         }
// 
//         this.callback = callback;
//         this.subject = subject;
//         super.executor.run(this);
//     }
// 
// 
//     //Interactor Use case
//     @Override
//     public void run() {
//         super.subjectRepository.deleteSubject(subject, new SubjectRepository.SubjectUseCase() {
//             @Override
//             public void onMissionAccomplished(final Subject subject) {
//                 DeleteSubjectUseCaseImp.super.mainThread.post(new Runnable() {
//                     @Override
//                     public void run() {
//                         callback.onMissionAccomplished(subject);
//                     }
//                 });
//             }
// 
//             @Override
//             public void onError(final SubjectException subjectException) {
//                 DeleteSubjectUseCaseImp.super.mainThread.post(new Runnable() {
//                     @Override
//                     public void run() {
//                         callback.onError(subjectException);
//                     }
//                 });
//             }
//         });
//     }
// }
// 
// Path: app/src/main/java/com/tonilopezmr/sample/domain/interactor/SubjectUseCase.java
// public interface SubjectUseCase extends Interactor {
// 
//     interface Callback {
//         void onMissionAccomplished(Subject subject);
//         void onError(SubjectException ex);
//     }
// 
//     public void execute(Subject subject, final Callback callback);
// }
// 
// Path: app/src/main/java/com/tonilopezmr/sample/domain/interactor/CreateSubjectUseCaseImp.java
// public class CreateSubjectUseCaseImp extends AbstractSubjectUseCase implements SubjectUseCase {
// 
//     private Callback callback;
//     private Subject subject;
// 
//     public CreateSubjectUseCaseImp(Executor executor, MainThread mainThread, SubjectRepository subjectRepository) {
//         super(executor, mainThread, subjectRepository);
//     }
// 
//     @Override
//     public void execute(Subject subject, final Callback callback) {
//         if (callback == null){
//             throw new IllegalArgumentException("Callback parameter can't be null");
//         }
// 
//         this.callback = callback;
//         this.subject = subject;
//         super.executor.run(this);
//     }
// 
// 
//     //Interactor Use case
//     @Override
//     public void run() {
//         try {
//             Thread.sleep(1000);
//         } catch (InterruptedException e) {
//             e.printStackTrace();
//         }
// 
//         super.subjectRepository.createSubject(this.subject, new SubjectRepository.SubjectUseCase() {
//             @Override
//             public void onMissionAccomplished(final Subject subject) {
//                 CreateSubjectUseCaseImp.super.mainThread.post(new Runnable() {
//                     @Override
//                     public void run() {
//                         callback.onMissionAccomplished(subject);
//                     }
//                 });
//             }
// 
//             @Override
//             public void onError(final SubjectException subjectException) {
//                 CreateSubjectUseCaseImp.super.mainThread.post(new Runnable() {
//                     @Override
//                     public void run() {
//                         callback.onError(subjectException);
//                     }
//                 });
//             }
//         });
//     }
// }
// 
// Path: app/src/main/java/com/tonilopezmr/sample/domain/interactor/GetSubjectListUseCase.java
// public interface GetSubjectListUseCase extends Interactor {
// 
//     interface Callback{
//         void onSubjectListLoaded(Collection<Subject> subjects);
//         void onError(SubjectException exception);
//     }
// 
//     public void execute(final Callback callback);
// }
// 
// Path: app/src/main/java/com/tonilopezmr/sample/domain/repository/SubjectRepository.java
// public interface SubjectRepository {
// 
//     interface SubjectListCallback {
//         void onSubjectListLoader(Collection<Subject> subjects);
//         void onError(SubjectException subjectException);
//     }
// 
//     interface SubjectUseCase {
//         void onMissionAccomplished(Subject subject);
//         void onError(SubjectException subjectException);
//     }
// 
//     void getSubjectsCollection(SubjectListCallback callback) throws SubjectException;
// 
//     void createSubject(Subject subject, SubjectUseCase callback) throws SubjectException;
//     void deleteSubject(Subject subject, SubjectUseCase callback) throws  SubjectException;
// }
// 
// Path: app/src/main/java/com/tonilopezmr/sample/executor/Executor.java
// public interface Executor {
//     void run(final Interactor interactor);
// }
// 
// Path: app/src/main/java/com/tonilopezmr/sample/executor/MainThread.java
// public interface MainThread {
//     void post(final Runnable runnable);
// }


// Path: app/src/main/java/com/tonilopezmr/sample/di/modules/InteractorModule.java
import com.tonilopezmr.sample.domain.interactor.DeleteSubjectUseCaseImp;
import com.tonilopezmr.sample.domain.interactor.SubjectUseCase;
import com.tonilopezmr.sample.domain.interactor.CreateSubjectUseCaseImp;
import com.tonilopezmr.sample.domain.interactor.GetSubjectListUseCase;
import com.tonilopezmr.sample.domain.interactor.GetSubjectListUseCaseImp;
import com.tonilopezmr.sample.domain.repository.SubjectRepository;
import com.tonilopezmr.sample.executor.Executor;
import com.tonilopezmr.sample.executor.MainThread;
import javax.inject.Named;
import dagger.Module;
import dagger.Provides;

package com.tonilopezmr.sample.di.modules;




/**
 *
 * @author Toni
 */
@Module(
        complete = false,
        library = true
)
public final class InteractorModule {

    @Named("delete usecase")
    @Provides
    public SubjectUseCase provideDeleteSubjectUseCase(Executor executor, MainThread mainThread, @Named("internal_database")SubjectRepository subjectRepository){
        return new DeleteSubjectUseCaseImp(executor, mainThread, subjectRepository);
    }

    @Named("create usecase")
    @Provides
    public SubjectUseCase provideCreateSubjectUseCase(Executor executor, MainThread mainThread, @Named("internal_database")SubjectRepository subjectRepository){
        return new CreateSubjectUseCaseImp(executor, mainThread, subjectRepository);
    }

    @Provides
    public GetSubjectListUseCase provideGetSubjectListUseCase(Executor executor, MainThread mainThread, @Named("internal_database")SubjectRepository subjectRepository){