// Path: base/src/main/java/io/kimo/base/utils/domain/BaseMapper.java
// public abstract class BaseMapper <E, M> {
// 
//     public abstract M toModel(E entity);
//     public abstract String serializeModel(M model);
//     public abstract M deserializeModel(String serializedModel);
// 
//     public List<M> toModels(List<E> entities) {
//         List<M> models = new ArrayList<>();
// 
//         for (E e : entities) {
//             models.add(toModel(e));
//         }
// 
//         return models;
//     }
// 
//     public List<String> serializeModels(List<M> models) {
//         List<String> serializedModels = new ArrayList<>();
// 
//         for (M model : models) {
//             serializedModels.add(serializeModel(model));
//         }
// 
//         return serializedModels;
//     }
// 
//     public List<M> deserializeModels(List<String> serializedModels) {
//         List<M> deserializedModels = new ArrayList<>();
// 
//         for (String serializedModel : serializedModels) {
//             deserializedModels.add(deserializeModel(serializedModel));
//         }
// 
//         return deserializedModels;
//     }
// }
// 
// Path: base/src/main/java/io/kimo/base/utils/domain/Callback.java
// public interface Callback<R> {
//     void onSuccess(R result);
//     void onError(String error);
// }
// 
// Path: base/src/main/java/io/kimo/base/utils/domain/Entity.java
// public interface Entity {
//     long getEntityId();
// }
// 
// Path: base/src/main/java/io/kimo/base/utils/domain/usecase/LoadCollectionUseCase.java
// public abstract class LoadCollectionUseCase<E extends Entity> extends BaseUseCase<List<E>> {
// 
//     public LoadCollectionUseCase() {
//         super(new SilentCallback() {
//             @Override
//             public void onSuccess(Object result) {}
//             @Override
//             public void onError(String error) {}
//         });
//     }
// 
//     public void setCallback(Callback<List<E>> callback) {
//         this.mCallback = callback;
//     }
// }
// 
// Path: base/src/main/java/io/kimo/base/utils/mvp/BasePresenter.java
// public abstract class BasePresenter<V extends Base.View> implements Base.Presenter {
// 
//     protected V mView;
// 
//     public BasePresenter(V view) {
//         this.mView = view;
//     }
// 
//     @Override
//     public void createView() {
//         hideAllViews();
//     }
// 
//     protected abstract void hideAllViews();
// }
// 
// Path: base/src/main/java/io/kimo/base/utils/mvp/Model.java
// public interface Model {
//     long getModelId();
// }
// 
// Path: base/src/main/java/io/kimo/base/utils/mvp/view/LoadDataCollectionView.java
// public interface LoadDataCollectionView<M extends Model> extends LoadDataView, CollectionView<M> {
//     void showFeedback(String msg);
// }


import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.Executor;
import io.kimo.base.utils.domain.BaseMapper;
import io.kimo.base.utils.domain.Callback;
import io.kimo.base.utils.domain.Entity;
import io.kimo.base.utils.domain.usecase.LoadCollectionUseCase;
import io.kimo.base.utils.mvp.BasePresenter;
import io.kimo.base.utils.mvp.Model;
import io.kimo.base.utils.mvp.view.LoadDataCollectionView;
package io.kimo.base.utils.mvp.presenter;




public class LoadDataCollectionPresenter<E extends Entity, M extends Model> extends BasePresenter<LoadDataCollectionView<M>> {

    protected Executor mExecutor;
    protected LoadCollectionUseCase<E> mUseCase;
    protected BaseMapper<E,M> mMapper;
    protected List<E> mLoadedCollection = new ArrayList<>();

// Path: base/src/main/java/io/kimo/base/utils/domain/BaseMapper.java
// public abstract class BaseMapper <E, M> {
// 
//     public abstract M toModel(E entity);
//     public abstract String serializeModel(M model);
//     public abstract M deserializeModel(String serializedModel);
// 
//     public List<M> toModels(List<E> entities) {
//         List<M> models = new ArrayList<>();
// 
//         for (E e : entities) {
//             models.add(toModel(e));
//         }
// 
//         return models;
//     }
// 
//     public List<String> serializeModels(List<M> models) {
//         List<String> serializedModels = new ArrayList<>();
// 
//         for (M model : models) {
//             serializedModels.add(serializeModel(model));
//         }
// 
//         return serializedModels;
//     }
// 
//     public List<M> deserializeModels(List<String> serializedModels) {
//         List<M> deserializedModels = new ArrayList<>();
// 
//         for (String serializedModel : serializedModels) {
//             deserializedModels.add(deserializeModel(serializedModel));
//         }
// 
//         return deserializedModels;
//     }
// }
// 
// Path: base/src/main/java/io/kimo/base/utils/domain/Callback.java
// public interface Callback<R> {
//     void onSuccess(R result);
//     void onError(String error);
// }
// 
// Path: base/src/main/java/io/kimo/base/utils/domain/Entity.java
// public interface Entity {
//     long getEntityId();
// }
// 
// Path: base/src/main/java/io/kimo/base/utils/domain/usecase/LoadCollectionUseCase.java
// public abstract class LoadCollectionUseCase<E extends Entity> extends BaseUseCase<List<E>> {
// 
//     public LoadCollectionUseCase() {
//         super(new SilentCallback() {
//             @Override
//             public void onSuccess(Object result) {}
//             @Override
//             public void onError(String error) {}
//         });
//     }
// 
//     public void setCallback(Callback<List<E>> callback) {
//         this.mCallback = callback;
//     }
// }
// 
// Path: base/src/main/java/io/kimo/base/utils/mvp/BasePresenter.java
// public abstract class BasePresenter<V extends Base.View> implements Base.Presenter {
// 
//     protected V mView;
// 
//     public BasePresenter(V view) {
//         this.mView = view;
//     }
// 
//     @Override
//     public void createView() {
//         hideAllViews();
//     }
// 
//     protected abstract void hideAllViews();
// }
// 
// Path: base/src/main/java/io/kimo/base/utils/mvp/Model.java
// public interface Model {
//     long getModelId();
// }
// 
// Path: base/src/main/java/io/kimo/base/utils/mvp/view/LoadDataCollectionView.java
// public interface LoadDataCollectionView<M extends Model> extends LoadDataView, CollectionView<M> {
//     void showFeedback(String msg);
// }


// Path: base/src/main/java/io/kimo/base/utils/mvp/presenter/LoadDataCollectionPresenter.java
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.Executor;
import io.kimo.base.utils.domain.BaseMapper;
import io.kimo.base.utils.domain.Callback;
import io.kimo.base.utils.domain.Entity;
import io.kimo.base.utils.domain.usecase.LoadCollectionUseCase;
import io.kimo.base.utils.mvp.BasePresenter;
import io.kimo.base.utils.mvp.Model;
import io.kimo.base.utils.mvp.view.LoadDataCollectionView;

package io.kimo.base.utils.mvp.presenter;




public class LoadDataCollectionPresenter<E extends Entity, M extends Model> extends BasePresenter<LoadDataCollectionView<M>> {

    protected Executor mExecutor;
    protected LoadCollectionUseCase<E> mUseCase;
    protected BaseMapper<E,M> mMapper;
    protected List<E> mLoadedCollection = new ArrayList<>();

    public LoadDataCollectionPresenter(LoadDataCollectionView<M> view, BaseMapper<E, M> mapper, LoadCollectionUseCase<E> useCase, Executor executor) {