// Path: repository/src/main/java/sergio/vasco/androidforexample/repository/datasources/ContactsDataSource.java
// public interface ContactsDataSource {
//   void insertContact(Contact contact);
//   void deleteContact();
//   void updateContact();
//   List<Contact> getContacts();
// }
// 
// Path: data/src/main/java/sergio/vasco/realmforandroid/data/repository/database/DataBaseService.java
// public interface DataBaseService {
//   void getInstance();
//   void insert(RealmObject table);
//   <E extends RealmObject> RealmResults<E> query (Class<E> genericClass);
//   <E extends RealmObject> int getNextId(String idName, Class<E> genericClass);
//   void beginTransaction();
//   void commitTransaction();
// }
// 
// Path: data/src/main/java/sergio/vasco/realmforandroid/data/repository/database/datasources/ContactsDataSourceImp.java
// public class ContactsDataSourceImp implements ContactsDataSource {
// 
//   private DataBaseService dataBaseService;
//   private DataContactMapper dataContactMapper;
// 
//   public ContactsDataSourceImp(DataBaseService dataBaseService) {
//     this.dataBaseService = dataBaseService;
//     this.dataContactMapper = new DataContactMapper();
//   }
// 
//   @Override public void insertContact(Contact contact) {
//     DataBaseContact dataBaseContact = dataContactMapper.contactToDataBaseContact(contact);
//     int nextId = dataBaseService.getNextId("idContact", DataBaseContact.class);
//     dataBaseContact.setIdContact(nextId);
//     dataBaseService.insert(dataBaseContact);
//   }
// 
//   @Override public void deleteContact() {
// 
//   }
// 
//   @Override public void updateContact() {
// 
//   }
// 
//   @Override public List<Contact> getContacts() {
//     List<Contact> contactList = new ArrayList<>();
// 
//     RealmResults<DataBaseContact> resultsList = dataBaseService.query(DataBaseContact.class);
//     for (DataBaseContact dataBaseContact : resultsList) {
//       Contact contact = dataContactMapper.dataBaseContactToContact(dataBaseContact);
//       contactList.add(contact);
//     }
// 
//     return contactList;
//   }
// }


import dagger.Module;
import dagger.Provides;
import javax.inject.Singleton;
import sergio.vasco.androidforexample.repository.datasources.ContactsDataSource;
import sergio.vasco.realmforandroid.data.repository.database.DataBaseService;
import sergio.vasco.realmforandroid.data.repository.database.datasources.ContactsDataSourceImp;
package sergio.vasco.realmforandroid.app.di.modules;


/**
 * Name: Sergio Vasco
 * Date: 26/1/16.
 */
@Module
public class DataSourceModule {

// Path: repository/src/main/java/sergio/vasco/androidforexample/repository/datasources/ContactsDataSource.java
// public interface ContactsDataSource {
//   void insertContact(Contact contact);
//   void deleteContact();
//   void updateContact();
//   List<Contact> getContacts();
// }
// 
// Path: data/src/main/java/sergio/vasco/realmforandroid/data/repository/database/DataBaseService.java
// public interface DataBaseService {
//   void getInstance();
//   void insert(RealmObject table);
//   <E extends RealmObject> RealmResults<E> query (Class<E> genericClass);
//   <E extends RealmObject> int getNextId(String idName, Class<E> genericClass);
//   void beginTransaction();
//   void commitTransaction();
// }
// 
// Path: data/src/main/java/sergio/vasco/realmforandroid/data/repository/database/datasources/ContactsDataSourceImp.java
// public class ContactsDataSourceImp implements ContactsDataSource {
// 
//   private DataBaseService dataBaseService;
//   private DataContactMapper dataContactMapper;
// 
//   public ContactsDataSourceImp(DataBaseService dataBaseService) {
//     this.dataBaseService = dataBaseService;
//     this.dataContactMapper = new DataContactMapper();
//   }
// 
//   @Override public void insertContact(Contact contact) {
//     DataBaseContact dataBaseContact = dataContactMapper.contactToDataBaseContact(contact);
//     int nextId = dataBaseService.getNextId("idContact", DataBaseContact.class);
//     dataBaseContact.setIdContact(nextId);
//     dataBaseService.insert(dataBaseContact);
//   }
// 
//   @Override public void deleteContact() {
// 
//   }
// 
//   @Override public void updateContact() {
// 
//   }
// 
//   @Override public List<Contact> getContacts() {
//     List<Contact> contactList = new ArrayList<>();
// 
//     RealmResults<DataBaseContact> resultsList = dataBaseService.query(DataBaseContact.class);
//     for (DataBaseContact dataBaseContact : resultsList) {
//       Contact contact = dataContactMapper.dataBaseContactToContact(dataBaseContact);
//       contactList.add(contact);
//     }
// 
//     return contactList;
//   }
// }


// Path: app/src/main/java/sergio/vasco/realmforandroid/app/di/modules/DataSourceModule.java
import dagger.Module;
import dagger.Provides;
import javax.inject.Singleton;
import sergio.vasco.androidforexample.repository.datasources.ContactsDataSource;
import sergio.vasco.realmforandroid.data.repository.database.DataBaseService;
import sergio.vasco.realmforandroid.data.repository.database.datasources.ContactsDataSourceImp;

package sergio.vasco.realmforandroid.app.di.modules;


/**
 * Name: Sergio Vasco
 * Date: 26/1/16.
 */
@Module
public class DataSourceModule {

  @Singleton @Provides ContactsDataSource provideContactsDataSource(DataBaseService dataBaseService){