// Path: app/src/main/java/com/marcohc/architecture/app/data/datastore/user/UserCloudDataStore.java
// public interface UserCloudDataStore {
// 
//     /**
//      * Get all users.
//      *
//      * @return the observable with users
//      */
//     Observable<List<UserEntity>> getAll();
// 
// }
// 
// Path: app/src/main/java/com/marcohc/architecture/app/data/datastore/user/UserDiskDataStore.java
// public interface UserDiskDataStore {
// 
//     String ALL_WITH_PICTURE = "all_with_picture";
//     String ALL_WITHOUT_PICTURE = "all_without_picture";
// 
//     /**
//      * Get users with picture.
//      *
//      * @return the observable with users
//      */
//     Observable<List<UserEntity>> getUsersWithPicture();
// 
//     /**
//      * Get users without pictures.
//      *
//      * @return the observable with users
//      */
//     Observable<List<UserEntity>> getUsersWithoutPicture();
// 
//     /**
//      * Checks if the value is stored.
//      *
//      * @param cacheKey the key for the cache
//      * @return true if is store, false otherwise
//      */
//     boolean isCached(String cacheKey);
// 
//     /**
//      * Puts the list in the cache with the specific cache key.
//      *
//      * @param cacheKey the key for the cache
//      * @param entityList the list of entities to persist
//      */
//     void put(String cacheKey, List<UserEntity> entityList);
// }
// 
// Path: app/src/main/java/com/marcohc/architecture/app/data/factory/UserDataStoreFactory.java
// public final class UserDataStoreFactory {
// 
//     public static UserDiskDataStore createUserDiskDataStore() {
//         return new UserCacheDataStore();
//     }
// 
//     public static UserCloudDataStore createUserWithoutPicturesCloudDataStore() {
//         return new UsersWithoutPictureDataStore();
//     }
// 
//     public static UserCloudDataStore createUserWithPicturesCloudDataStore() {
//         return new UsersWithPictureDataStore();
//     }
// 
// }
// 
// Path: app/src/main/java/com/marcohc/architecture/app/domain/entity/UserEntity.java
// public class UserEntity implements Entity {
// 
//     // ************************************************************************************************************************************************************************
//     // * Attributes
//     // ************************************************************************************************************************************************************************
// 
//     @SerializedName("name")
//     private String mName;
// 
//     @SerializedName("email")
//     private String mEmail;
// 
//     @SerializedName("pictureUrl")
//     private String mPictureUrl;
// 
//     // ************************************************************************************************************************************************************************
//     // * Constructors
//     // ************************************************************************************************************************************************************************
// 
//     public UserEntity() {
//         mName = "Unknown";
//         mEmail = "Unknown";
//     }
// 
//     // ************************************************************************************************************************************************************************
//     // * Getter and setters
//     // ************************************************************************************************************************************************************************
// 
//     public String getName() {
//         return mName;
//     }
// 
//     public void setName(String name) {
//         this.mName = name;
//     }
// 
//     public String getEmail() {
//         return mEmail;
//     }
// 
//     public void setEmail(String email) {
//         this.mEmail = email;
//     }
// 
//     public String getPictureUrl() {
//         return mPictureUrl;
//     }
// 
//     public void setPictureUrl(String pictureUrl) {
//         this.mPictureUrl = pictureUrl;
//     }
// 
// }


import com.marcohc.architecture.app.data.datastore.user.UserCloudDataStore;
import com.marcohc.architecture.app.data.datastore.user.UserDiskDataStore;
import com.marcohc.architecture.app.data.factory.UserDataStoreFactory;
import com.marcohc.architecture.app.domain.entity.UserEntity;
import java.util.List;
import javax.inject.Singleton;
import rx.Observable;
import rx.functions.Action1;
import static com.marcohc.architecture.app.data.datastore.user.UserDiskDataStore.ALL_WITHOUT_PICTURE;
import static com.marcohc.architecture.app.data.datastore.user.UserDiskDataStore.ALL_WITH_PICTURE;
package com.marcohc.architecture.app.data.repository.user;






/**
 * A repository class must be created for each model in the application.
 * <p>
 * It provides data retrieved from its factory
 *
 * @author Marco Hernaiz
 * @since 08/08/16
 */
@Singleton
public class UserRepositoryImpl implements UserRepository {

    private final UserDiskDataStore diskDataStore;
    private final UserCloudDataStore userWithPicturesCloudDataStore;
// Path: app/src/main/java/com/marcohc/architecture/app/data/datastore/user/UserCloudDataStore.java
// public interface UserCloudDataStore {
// 
//     /**
//      * Get all users.
//      *
//      * @return the observable with users
//      */
//     Observable<List<UserEntity>> getAll();
// 
// }
// 
// Path: app/src/main/java/com/marcohc/architecture/app/data/datastore/user/UserDiskDataStore.java
// public interface UserDiskDataStore {
// 
//     String ALL_WITH_PICTURE = "all_with_picture";
//     String ALL_WITHOUT_PICTURE = "all_without_picture";
// 
//     /**
//      * Get users with picture.
//      *
//      * @return the observable with users
//      */
//     Observable<List<UserEntity>> getUsersWithPicture();
// 
//     /**
//      * Get users without pictures.
//      *
//      * @return the observable with users
//      */
//     Observable<List<UserEntity>> getUsersWithoutPicture();
// 
//     /**
//      * Checks if the value is stored.
//      *
//      * @param cacheKey the key for the cache
//      * @return true if is store, false otherwise
//      */
//     boolean isCached(String cacheKey);
// 
//     /**
//      * Puts the list in the cache with the specific cache key.
//      *
//      * @param cacheKey the key for the cache
//      * @param entityList the list of entities to persist
//      */
//     void put(String cacheKey, List<UserEntity> entityList);
// }
// 
// Path: app/src/main/java/com/marcohc/architecture/app/data/factory/UserDataStoreFactory.java
// public final class UserDataStoreFactory {
// 
//     public static UserDiskDataStore createUserDiskDataStore() {
//         return new UserCacheDataStore();
//     }
// 
//     public static UserCloudDataStore createUserWithoutPicturesCloudDataStore() {
//         return new UsersWithoutPictureDataStore();
//     }
// 
//     public static UserCloudDataStore createUserWithPicturesCloudDataStore() {
//         return new UsersWithPictureDataStore();
//     }
// 
// }
// 
// Path: app/src/main/java/com/marcohc/architecture/app/domain/entity/UserEntity.java
// public class UserEntity implements Entity {
// 
//     // ************************************************************************************************************************************************************************
//     // * Attributes
//     // ************************************************************************************************************************************************************************
// 
//     @SerializedName("name")
//     private String mName;
// 
//     @SerializedName("email")
//     private String mEmail;
// 
//     @SerializedName("pictureUrl")
//     private String mPictureUrl;
// 
//     // ************************************************************************************************************************************************************************
//     // * Constructors
//     // ************************************************************************************************************************************************************************
// 
//     public UserEntity() {
//         mName = "Unknown";
//         mEmail = "Unknown";
//     }
// 
//     // ************************************************************************************************************************************************************************
//     // * Getter and setters
//     // ************************************************************************************************************************************************************************
// 
//     public String getName() {
//         return mName;
//     }
// 
//     public void setName(String name) {
//         this.mName = name;
//     }
// 
//     public String getEmail() {
//         return mEmail;
//     }
// 
//     public void setEmail(String email) {
//         this.mEmail = email;
//     }
// 
//     public String getPictureUrl() {
//         return mPictureUrl;
//     }
// 
//     public void setPictureUrl(String pictureUrl) {
//         this.mPictureUrl = pictureUrl;
//     }
// 
// }


// Path: app/src/main/java/com/marcohc/architecture/app/data/repository/user/UserRepositoryImpl.java
import com.marcohc.architecture.app.data.datastore.user.UserCloudDataStore;
import com.marcohc.architecture.app.data.datastore.user.UserDiskDataStore;
import com.marcohc.architecture.app.data.factory.UserDataStoreFactory;
import com.marcohc.architecture.app.domain.entity.UserEntity;
import java.util.List;
import javax.inject.Singleton;
import rx.Observable;
import rx.functions.Action1;
import static com.marcohc.architecture.app.data.datastore.user.UserDiskDataStore.ALL_WITHOUT_PICTURE;
import static com.marcohc.architecture.app.data.datastore.user.UserDiskDataStore.ALL_WITH_PICTURE;

package com.marcohc.architecture.app.data.repository.user;






/**
 * A repository class must be created for each model in the application.
 * <p>
 * It provides data retrieved from its factory
 *
 * @author Marco Hernaiz
 * @since 08/08/16
 */
@Singleton
public class UserRepositoryImpl implements UserRepository {

    private final UserDiskDataStore diskDataStore;
    private final UserCloudDataStore userWithPicturesCloudDataStore;
    private final UserCloudDataStore userWithoutPicturesCloudDataStore;