// Path: app/src/main/java/com/lucilu/rxdynamicsearch/provider/JsonParserProvider.java
// public final class JsonParserProvider implements IJsonParserProvider {
// 
//     @NonNull
//     private final Gson mGson;
// 
//     @NonNull
//     private final IResourceProvider mResourceProvider;
// 
//     public JsonParserProvider(@NonNull final Gson gson,
//                               @NonNull final IResourceProvider resourceProvider) {
//         mGson = get(gson);
//         mResourceProvider = get(resourceProvider);
//     }
// 
//     @Override
//     public <T> Option<List<T>> parseListFromRawJsonFile(final int rawResourceId,
//                                                         @NonNull final Class<T> classOfType) {
//         Preconditions.assertWorkerThread();
// 
//         Type listType = new ListOfJsonType<>(classOfType);
//         InputStreamReader isr = new InputStreamReader(
//                 mResourceProvider.openRawResource(rawResourceId));
//         try {
//             List<T> list = mGson.fromJson(isr, listType);
//             return ofObj(list);
//         } catch (JsonSyntaxException e) {
//             Timber.e(e, "Error parsing from json %s", listType);
//             return none();
//         }
//     }
// }
// 
// Path: app/src/main/java/com/lucilu/rxdynamicsearch/provider/ResourceProvider.java
// public final class ResourceProvider implements IResourceProvider {
// 
//     @NonNull
//     private final Context mContext;
// 
//     public ResourceProvider(@NonNull final Context context) {
//         mContext = get(context);
//     }
// 
//     @NonNull
//     @Override
//     public InputStream openRawResource(final int id) {
//         return mContext.getResources().openRawResource(id);
//     }
// }
// 
// Path: app/src/main/java/com/lucilu/rxdynamicsearch/provider/base/IJsonParserProvider.java
// public interface IJsonParserProvider {
// 
//     /**
//      * Parses from
//      *
//      * @param rawResourceId the id to the raw json file in resources
//      * @param classOfType   the class of the type of the objects in the list
//      * @param <T>           the type of the objects in the list
//      * @return option of the list. Can be {@link Option#NONE} if the parsing fails.
//      */
//     <T> Option<List<T>> parseListFromRawJsonFile(final int rawResourceId,
//                                                  @NonNull final Class<T> classOfType);
// }
// 
// Path: app/src/main/java/com/lucilu/rxdynamicsearch/provider/base/IResourceProvider.java
// public interface IResourceProvider {
// 
//     /**
//      * {@link Resources#openRawResource(int)}
//      */
//     @NonNull
//     InputStream openRawResource(final int id);
// }


import com.google.gson.Gson;
import com.lucilu.rxdynamicsearch.dagger.Qualifiers.ForApplication;
import com.lucilu.rxdynamicsearch.provider.JsonParserProvider;
import com.lucilu.rxdynamicsearch.provider.ResourceProvider;
import com.lucilu.rxdynamicsearch.provider.base.IJsonParserProvider;
import com.lucilu.rxdynamicsearch.provider.base.IResourceProvider;
import android.content.Context;
import android.support.annotation.NonNull;
import dagger.Module;
import dagger.Provides;
package com.lucilu.rxdynamicsearch.dagger.module;





@Module(includes = DataModule.class)
public final class ProviderModule {

    @Provides
    IResourceProvider provideResourceProvider(@ForApplication final Context context) {
        return new ResourceProvider(context);
    }

    @Provides
// Path: app/src/main/java/com/lucilu/rxdynamicsearch/provider/JsonParserProvider.java
// public final class JsonParserProvider implements IJsonParserProvider {
// 
//     @NonNull
//     private final Gson mGson;
// 
//     @NonNull
//     private final IResourceProvider mResourceProvider;
// 
//     public JsonParserProvider(@NonNull final Gson gson,
//                               @NonNull final IResourceProvider resourceProvider) {
//         mGson = get(gson);
//         mResourceProvider = get(resourceProvider);
//     }
// 
//     @Override
//     public <T> Option<List<T>> parseListFromRawJsonFile(final int rawResourceId,
//                                                         @NonNull final Class<T> classOfType) {
//         Preconditions.assertWorkerThread();
// 
//         Type listType = new ListOfJsonType<>(classOfType);
//         InputStreamReader isr = new InputStreamReader(
//                 mResourceProvider.openRawResource(rawResourceId));
//         try {
//             List<T> list = mGson.fromJson(isr, listType);
//             return ofObj(list);
//         } catch (JsonSyntaxException e) {
//             Timber.e(e, "Error parsing from json %s", listType);
//             return none();
//         }
//     }
// }
// 
// Path: app/src/main/java/com/lucilu/rxdynamicsearch/provider/ResourceProvider.java
// public final class ResourceProvider implements IResourceProvider {
// 
//     @NonNull
//     private final Context mContext;
// 
//     public ResourceProvider(@NonNull final Context context) {
//         mContext = get(context);
//     }
// 
//     @NonNull
//     @Override
//     public InputStream openRawResource(final int id) {
//         return mContext.getResources().openRawResource(id);
//     }
// }
// 
// Path: app/src/main/java/com/lucilu/rxdynamicsearch/provider/base/IJsonParserProvider.java
// public interface IJsonParserProvider {
// 
//     /**
//      * Parses from
//      *
//      * @param rawResourceId the id to the raw json file in resources
//      * @param classOfType   the class of the type of the objects in the list
//      * @param <T>           the type of the objects in the list
//      * @return option of the list. Can be {@link Option#NONE} if the parsing fails.
//      */
//     <T> Option<List<T>> parseListFromRawJsonFile(final int rawResourceId,
//                                                  @NonNull final Class<T> classOfType);
// }
// 
// Path: app/src/main/java/com/lucilu/rxdynamicsearch/provider/base/IResourceProvider.java
// public interface IResourceProvider {
// 
//     /**
//      * {@link Resources#openRawResource(int)}
//      */
//     @NonNull
//     InputStream openRawResource(final int id);
// }


// Path: app/src/main/java/com/lucilu/rxdynamicsearch/dagger/module/ProviderModule.java
import com.google.gson.Gson;
import com.lucilu.rxdynamicsearch.dagger.Qualifiers.ForApplication;
import com.lucilu.rxdynamicsearch.provider.JsonParserProvider;
import com.lucilu.rxdynamicsearch.provider.ResourceProvider;
import com.lucilu.rxdynamicsearch.provider.base.IJsonParserProvider;
import com.lucilu.rxdynamicsearch.provider.base.IResourceProvider;
import android.content.Context;
import android.support.annotation.NonNull;
import dagger.Module;
import dagger.Provides;

package com.lucilu.rxdynamicsearch.dagger.module;





@Module(includes = DataModule.class)
public final class ProviderModule {

    @Provides
    IResourceProvider provideResourceProvider(@ForApplication final Context context) {
        return new ResourceProvider(context);
    }

    @Provides
    IJsonParserProvider provideJsonParserProvider(@NonNull final Gson gson,