// Path: android/src/main/java/com/raulh82vlc/TransactionsViewer/domain/MainThreadImpl.java
// public class MainThreadImpl implements MainThread {
// 
//     private Handler handler;
// 
//     @Inject
//     MainThreadImpl() {
//         this.handler = new Handler(Looper.getMainLooper());
//     }
// 
//     @Override
//     public void post(Runnable runnable) {
//         handler.post(runnable);
//     }
// }
// 
// Path: domain/src/main/java/com/raulh82vlc/TransactionsViewer/domain/executors/InteractorExecutor.java
// public interface InteractorExecutor {
//     void run(Interactor interactor) throws CustomException;
// }
// 
// Path: domain/src/main/java/com/raulh82vlc/TransactionsViewer/domain/executors/MainThread.java
// public interface MainThread {
//     void post(final Runnable runnable);
// }
// 
// Path: domain/src/main/java/com/raulh82vlc/TransactionsViewer/domain/executors/ThreadsPoolExecutor.java
// public class ThreadsPoolExecutor implements InteractorExecutor {
//     /**
//      * Constants
//      */
//     private static final int MAX_SIZE = 6;
//     private static final int CORE_DEFAULT_SIZE = 3;
//     private static final int TIME_OUT_TIME = 300;
//     private static final TimeUnit TIME_UNITS = TimeUnit.SECONDS;
//     /**
//      * Local variables
//      */
//     private ThreadPoolExecutor threadsPoolExecutor;
// 
// 
//     @Inject
//     ThreadsPoolExecutor() {
//         BlockingQueue<Runnable> mWorkersQueue = new LinkedBlockingQueue<>();
//         threadsPoolExecutor = new ThreadPoolExecutor(CORE_DEFAULT_SIZE, MAX_SIZE,
//                 TIME_OUT_TIME, TIME_UNITS, mWorkersQueue);
//     }
// 
//     @Override
//     public void run(final Interactor interactor) throws CustomException {
//         if (interactor == null) {
//             throw new IllegalArgumentException("Interactor must be instantiated");
//         }
//         threadsPoolExecutor.submit(new Runnable() {
//             @Override
//             public void run() {
//                 try {
//                     interactor.run();
//                 } catch (CustomException e) {
//                     e.printStackTrace();
//                 }
//             }
//         });
//     }
// }


import android.app.Application;
import android.content.Context;
import com.raulh82vlc.TransactionsViewer.domain.MainThreadImpl;
import com.raulh82vlc.TransactionsViewer.domain.executors.InteractorExecutor;
import com.raulh82vlc.TransactionsViewer.domain.executors.MainThread;
import com.raulh82vlc.TransactionsViewer.domain.executors.ThreadsPoolExecutor;
import javax.inject.Singleton;
import dagger.Module;
import dagger.Provides;
/*
 * Copyright (C) 2017 Raul Hernandez Lopez @raulh82vlc
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.raulh82vlc.TransactionsViewer.di.modules;





/**
 * Module which provides application context or generic dependencies.
 *
 * @author Raul Hernandez Lopez
 */
@Module
public class ApplicationModule {
    private final Application application;

    public ApplicationModule(Application application) {
        this.application = application;
    }

    @Provides
    @Singleton
    Application provideApplication() {
        return application;
    }

    @Provides
    @Singleton
// Path: android/src/main/java/com/raulh82vlc/TransactionsViewer/domain/MainThreadImpl.java
// public class MainThreadImpl implements MainThread {
// 
//     private Handler handler;
// 
//     @Inject
//     MainThreadImpl() {
//         this.handler = new Handler(Looper.getMainLooper());
//     }
// 
//     @Override
//     public void post(Runnable runnable) {
//         handler.post(runnable);
//     }
// }
// 
// Path: domain/src/main/java/com/raulh82vlc/TransactionsViewer/domain/executors/InteractorExecutor.java
// public interface InteractorExecutor {
//     void run(Interactor interactor) throws CustomException;
// }
// 
// Path: domain/src/main/java/com/raulh82vlc/TransactionsViewer/domain/executors/MainThread.java
// public interface MainThread {
//     void post(final Runnable runnable);
// }
// 
// Path: domain/src/main/java/com/raulh82vlc/TransactionsViewer/domain/executors/ThreadsPoolExecutor.java
// public class ThreadsPoolExecutor implements InteractorExecutor {
//     /**
//      * Constants
//      */
//     private static final int MAX_SIZE = 6;
//     private static final int CORE_DEFAULT_SIZE = 3;
//     private static final int TIME_OUT_TIME = 300;
//     private static final TimeUnit TIME_UNITS = TimeUnit.SECONDS;
//     /**
//      * Local variables
//      */
//     private ThreadPoolExecutor threadsPoolExecutor;
// 
// 
//     @Inject
//     ThreadsPoolExecutor() {
//         BlockingQueue<Runnable> mWorkersQueue = new LinkedBlockingQueue<>();
//         threadsPoolExecutor = new ThreadPoolExecutor(CORE_DEFAULT_SIZE, MAX_SIZE,
//                 TIME_OUT_TIME, TIME_UNITS, mWorkersQueue);
//     }
// 
//     @Override
//     public void run(final Interactor interactor) throws CustomException {
//         if (interactor == null) {
//             throw new IllegalArgumentException("Interactor must be instantiated");
//         }
//         threadsPoolExecutor.submit(new Runnable() {
//             @Override
//             public void run() {
//                 try {
//                     interactor.run();
//                 } catch (CustomException e) {
//                     e.printStackTrace();
//                 }
//             }
//         });
//     }
// }


// Path: android/src/main/java/com/raulh82vlc/TransactionsViewer/di/modules/ApplicationModule.java
import android.app.Application;
import android.content.Context;
import com.raulh82vlc.TransactionsViewer.domain.MainThreadImpl;
import com.raulh82vlc.TransactionsViewer.domain.executors.InteractorExecutor;
import com.raulh82vlc.TransactionsViewer.domain.executors.MainThread;
import com.raulh82vlc.TransactionsViewer.domain.executors.ThreadsPoolExecutor;
import javax.inject.Singleton;
import dagger.Module;
import dagger.Provides;

/*
 * Copyright (C) 2017 Raul Hernandez Lopez @raulh82vlc
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.raulh82vlc.TransactionsViewer.di.modules;





/**
 * Module which provides application context or generic dependencies.
 *
 * @author Raul Hernandez Lopez
 */
@Module
public class ApplicationModule {
    private final Application application;

    public ApplicationModule(Application application) {
        this.application = application;
    }

    @Provides
    @Singleton
    Application provideApplication() {
        return application;
    }

    @Provides
    @Singleton
    InteractorExecutor provideThreadsPoolExecutor(ThreadsPoolExecutor executor) {