// Path: domain/src/main/java/domain/foundation/helpers/ParserException.java
// public class ParserException extends UseCase<String> {
//     private Throwable throwable;
// 
//     @Inject public ParserException(UI ui) {
//         super(ui);
//     }
// 
//     public ParserException with(Throwable throwable) {
//         this.throwable = throwable;
//         return this;
//     }
// 
//     @Override public Observable<String> react() {
//         String message = throwable.getMessage();
// 
//         if (throwable instanceof CompositeException) {
//             message += System.getProperty("line.separator");
//             CompositeException compositeException = (CompositeException) throwable;
// 
//             for (Throwable exception : compositeException.getExceptions()) {
//                 String exceptionName = exception.getClass().getSimpleName();
//                 String exceptionMessage = exception.getMessage() != null ? exception.getMessage() : "";
//                 message += exceptionName + " -> " + exceptionMessage + System.getProperty("line.separator");
//             }
//         }
// 
//         return Observable.just(message);
//     }
// }
// 
// Path: domain/src/main/java/domain/foundation/schedulers/ObserveOn.java
// public interface ObserveOn {
//     Scheduler getScheduler();
// }
// 
// Path: domain/src/main/java/domain/foundation/schedulers/SubscribeOn.java
// public interface SubscribeOn {
//     Scheduler getScheduler();
// }
// 
// Path: domain/src/main/java/domain/sections/UI.java
// public interface UI {
//     Observable<String> errorNonEmptyFields();
//     Subscription showFeedback(Observable<String> oFeedback);
//     Subscription showAnchoredScreenFeedback(Observable<String> oFeedback);
// 
//     void showLoading();
//     void hideLoading();
// }
// 
// Path: domain/src/main/java/domain/sections/Wireframe.java
// public interface Wireframe {
//     void dashboard();
//     void searchUserScreen();
//     void userScreen();
//     void usersScreen();
//     void popCurrentScreen();
// }


import domain.foundation.helpers.ParserException;
import domain.foundation.schedulers.ObserveOn;
import domain.foundation.schedulers.SubscribeOn;
import domain.sections.UI;
import domain.sections.Wireframe;
import rx.Observable;
import rx.Subscription;
import rx.subscriptions.CompositeSubscription;
/*
 * Copyright 2015 RefineriaWeb
 *
 * 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 domain.foundation;


/**
 * Base class for any Presenter.
 * The presenter is responsible for linking the uses cases in order to create a logical unit
 * which will be represented as a screen in the application.
 * @param <V> The view interface attached to this presenter.
 * @see  BaseView
 */
public abstract class Presenter<V extends BaseView> {
    protected V view;
    protected final Wireframe wireframe;
    private final SubscribeOn subscribeOn;
    private final ObserveOn observeOn;
// Path: domain/src/main/java/domain/foundation/helpers/ParserException.java
// public class ParserException extends UseCase<String> {
//     private Throwable throwable;
// 
//     @Inject public ParserException(UI ui) {
//         super(ui);
//     }
// 
//     public ParserException with(Throwable throwable) {
//         this.throwable = throwable;
//         return this;
//     }
// 
//     @Override public Observable<String> react() {
//         String message = throwable.getMessage();
// 
//         if (throwable instanceof CompositeException) {
//             message += System.getProperty("line.separator");
//             CompositeException compositeException = (CompositeException) throwable;
// 
//             for (Throwable exception : compositeException.getExceptions()) {
//                 String exceptionName = exception.getClass().getSimpleName();
//                 String exceptionMessage = exception.getMessage() != null ? exception.getMessage() : "";
//                 message += exceptionName + " -> " + exceptionMessage + System.getProperty("line.separator");
//             }
//         }
// 
//         return Observable.just(message);
//     }
// }
// 
// Path: domain/src/main/java/domain/foundation/schedulers/ObserveOn.java
// public interface ObserveOn {
//     Scheduler getScheduler();
// }
// 
// Path: domain/src/main/java/domain/foundation/schedulers/SubscribeOn.java
// public interface SubscribeOn {
//     Scheduler getScheduler();
// }
// 
// Path: domain/src/main/java/domain/sections/UI.java
// public interface UI {
//     Observable<String> errorNonEmptyFields();
//     Subscription showFeedback(Observable<String> oFeedback);
//     Subscription showAnchoredScreenFeedback(Observable<String> oFeedback);
// 
//     void showLoading();
//     void hideLoading();
// }
// 
// Path: domain/src/main/java/domain/sections/Wireframe.java
// public interface Wireframe {
//     void dashboard();
//     void searchUserScreen();
//     void userScreen();
//     void usersScreen();
//     void popCurrentScreen();
// }


// Path: domain/src/main/java/domain/foundation/Presenter.java
import domain.foundation.helpers.ParserException;
import domain.foundation.schedulers.ObserveOn;
import domain.foundation.schedulers.SubscribeOn;
import domain.sections.UI;
import domain.sections.Wireframe;
import rx.Observable;
import rx.Subscription;
import rx.subscriptions.CompositeSubscription;

/*
 * Copyright 2015 RefineriaWeb
 *
 * 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 domain.foundation;


/**
 * Base class for any Presenter.
 * The presenter is responsible for linking the uses cases in order to create a logical unit
 * which will be represented as a screen in the application.
 * @param <V> The view interface attached to this presenter.
 * @see  BaseView
 */
public abstract class Presenter<V extends BaseView> {
    protected V view;
    protected final Wireframe wireframe;
    private final SubscribeOn subscribeOn;
    private final ObserveOn observeOn;
    private final ParserException parserException;