// Path: domain/src/main/java/com/raulh82vlc/TransactionsViewer/domain/interactors/GetRatesListInteractor.java
// public interface GetRatesListInteractor {
// 
//     void execute(String path, GetRatesListCallback callback) throws CustomException;
// 
//     interface GetRatesListCallback {
//         void onGetRatesListOK(List<Rate> rateList);
// 
//         void onGetRatesListKO(String error);
//     }
// }
// 
// Path: android/src/main/java/com/raulh82vlc/TransactionsViewer/domain/interactors/mappers/RatesListModelDataMapper.java
// @ActivityScope
// public class RatesListModelDataMapper {
// 
//     @Inject
//     RatesListModelDataMapper() {
// 
//     }
// 
//     /**
//      * Transforms a List of {@link Rate} into a List of Rates
//      *
//      * @param ratesList to be transformed.
//      * @return Graph composed by a dictionary of rate to others
//      */
//     public List<RateUI> transform(List<Rate> ratesList) {
//         if (ratesList == null) {
//             throw new IllegalArgumentException("Cannot transform a null value");
//         }
// 
//         int size = ratesList.size();
//         List<RateUI> listOfRates = new ArrayList<>(size);
//         if (size > 0) {
//             listOfRates = new ArrayList<>(size);
//             for (Rate rate : ratesList) {
//                 listOfRates.add(new RateUI(rate.getFromCurrency(), rate.getToCurrency(), rate.getRate()));
//             }
//         }
//         return listOfRates;
//     }
// }
// 
// Path: domain/src/main/java/com/raulh82vlc/TransactionsViewer/domain/models/Rate.java
// public class Rate {
//     @SerializedName("from")
//     private String fromCurrency;
//     @SerializedName("rate")
//     private String rate;
//     @SerializedName("to")
//     private String toCurrency;
// 
//     public String getFromCurrency() {
//         return fromCurrency;
//     }
// 
//     public String getRate() {
//         return rate;
//     }
// 
//     public String getToCurrency() {
//         return toCurrency;
//     }
// }
// 
// Path: android/src/main/java/com/raulh82vlc/TransactionsViewer/ui/presentation/RatesPresenter.java
// public interface RatesPresenter {
// 
//     void startReading(String path) throws CustomException;
// 
//     void setView(View view);
// 
//     void resetView();
// 
//     interface View {
//         void errorGettingRates(String error);
// 
//         void loadedRates(List<RateUI> listOfRates);
// 
//         boolean isReady();
//     }
// }


import com.raulh82vlc.TransactionsViewer.domain.interactors.GetRatesListInteractor;
import com.raulh82vlc.TransactionsViewer.domain.interactors.mappers.RatesListModelDataMapper;
import com.raulh82vlc.TransactionsViewer.domain.models.Rate;
import com.raulh82vlc.TransactionsViewer.ui.presentation.RatesPresenter;
import java.util.List;
/*
 * Copyright (C) 2017 Raul Hernandez Lopez @raulh82vlc
 *
 * 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 com.raulh82vlc.TransactionsViewer.domain.interactors_response;



/**
 * Get Rates list by means of its callback, communicating towards its view
 *
 * @author Raul Hernandez Lopez.
 */
public class GetRatesListCallbackImpl implements GetRatesListInteractor.GetRatesListCallback {

    private final RatesPresenter.View mView;
    private final RatesListModelDataMapper ratesListModelDataMapper;


    public GetRatesListCallbackImpl(RatesPresenter.View view,
                             RatesListModelDataMapper ratesListModelDataMapper) {
        mView = view;
        this.ratesListModelDataMapper = ratesListModelDataMapper;
    }

    @Override
// Path: domain/src/main/java/com/raulh82vlc/TransactionsViewer/domain/interactors/GetRatesListInteractor.java
// public interface GetRatesListInteractor {
// 
//     void execute(String path, GetRatesListCallback callback) throws CustomException;
// 
//     interface GetRatesListCallback {
//         void onGetRatesListOK(List<Rate> rateList);
// 
//         void onGetRatesListKO(String error);
//     }
// }
// 
// Path: android/src/main/java/com/raulh82vlc/TransactionsViewer/domain/interactors/mappers/RatesListModelDataMapper.java
// @ActivityScope
// public class RatesListModelDataMapper {
// 
//     @Inject
//     RatesListModelDataMapper() {
// 
//     }
// 
//     /**
//      * Transforms a List of {@link Rate} into a List of Rates
//      *
//      * @param ratesList to be transformed.
//      * @return Graph composed by a dictionary of rate to others
//      */
//     public List<RateUI> transform(List<Rate> ratesList) {
//         if (ratesList == null) {
//             throw new IllegalArgumentException("Cannot transform a null value");
//         }
// 
//         int size = ratesList.size();
//         List<RateUI> listOfRates = new ArrayList<>(size);
//         if (size > 0) {
//             listOfRates = new ArrayList<>(size);
//             for (Rate rate : ratesList) {
//                 listOfRates.add(new RateUI(rate.getFromCurrency(), rate.getToCurrency(), rate.getRate()));
//             }
//         }
//         return listOfRates;
//     }
// }
// 
// Path: domain/src/main/java/com/raulh82vlc/TransactionsViewer/domain/models/Rate.java
// public class Rate {
//     @SerializedName("from")
//     private String fromCurrency;
//     @SerializedName("rate")
//     private String rate;
//     @SerializedName("to")
//     private String toCurrency;
// 
//     public String getFromCurrency() {
//         return fromCurrency;
//     }
// 
//     public String getRate() {
//         return rate;
//     }
// 
//     public String getToCurrency() {
//         return toCurrency;
//     }
// }
// 
// Path: android/src/main/java/com/raulh82vlc/TransactionsViewer/ui/presentation/RatesPresenter.java
// public interface RatesPresenter {
// 
//     void startReading(String path) throws CustomException;
// 
//     void setView(View view);
// 
//     void resetView();
// 
//     interface View {
//         void errorGettingRates(String error);
// 
//         void loadedRates(List<RateUI> listOfRates);
// 
//         boolean isReady();
//     }
// }


// Path: android/src/main/java/com/raulh82vlc/TransactionsViewer/domain/interactors_response/GetRatesListCallbackImpl.java
import com.raulh82vlc.TransactionsViewer.domain.interactors.GetRatesListInteractor;
import com.raulh82vlc.TransactionsViewer.domain.interactors.mappers.RatesListModelDataMapper;
import com.raulh82vlc.TransactionsViewer.domain.models.Rate;
import com.raulh82vlc.TransactionsViewer.ui.presentation.RatesPresenter;
import java.util.List;

/*
 * Copyright (C) 2017 Raul Hernandez Lopez @raulh82vlc
 *
 * 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 com.raulh82vlc.TransactionsViewer.domain.interactors_response;



/**
 * Get Rates list by means of its callback, communicating towards its view
 *
 * @author Raul Hernandez Lopez.
 */
public class GetRatesListCallbackImpl implements GetRatesListInteractor.GetRatesListCallback {

    private final RatesPresenter.View mView;
    private final RatesListModelDataMapper ratesListModelDataMapper;


    public GetRatesListCallbackImpl(RatesPresenter.View view,
                             RatesListModelDataMapper ratesListModelDataMapper) {
        mView = view;
        this.ratesListModelDataMapper = ratesListModelDataMapper;
    }

    @Override
    public void onGetRatesListOK(List<Rate> rateList) {