// Path: core/src/main/java/cat/ppicas/cleanarch/model/City.java
// public class City {
// 
//     private String mId;
//     private String mName;
//     private String mCountry;
//     private CurrentWeatherPreview mCurrentWeatherPreview;
// 
//     public City(String id, String name, String country) {
//         mId = id;
//         mName = name;
//         mCountry = country;
//     }
// 
//     public City(String id, String name, String country,
//             CurrentWeatherPreview currentWeatherPreview) {
//         mId = id;
//         mName = name;
//         mCountry = country;
//         mCurrentWeatherPreview = currentWeatherPreview;
//     }
// 
//     public String getId() {
//         return mId;
//     }
// 
//     public String getName() {
//         return mName;
//     }
// 
//     public String getCountry() {
//         return mCountry;
//     }
// 
//     public CurrentWeatherPreview getCurrentWeatherPreview() {
//         return mCurrentWeatherPreview;
//     }
// }
// 
// Path: core/src/main/java/cat/ppicas/cleanarch/repository/CityRepository.java
// public interface CityRepository {
// 
//     City getCity(String cityId);
// 
//     List<City> findCity(String name);
// 
// }
// 
// Path: core/src/main/java/cat/ppicas/framework/task/Task.java
// public interface Task<R, E extends Exception> {
// 
//     TaskResult<R, E> execute();
// 
// }
// 
// Path: core/src/main/java/cat/ppicas/framework/task/TaskResult.java
// public class TaskResult<R, E extends Exception> {
// 
//     private final R mResult;
// 
//     private final E mError;
// 
//     private final boolean mCanceled;
// 
//     public static <R, E extends Exception> TaskResult<R, E> newSuccessResult(R result) {
//         return new TaskResult<>(result, null, false);
//     }
// 
//     public static <R, E extends Exception> TaskResult<R, E> newErrorResult(E error) {
//         return new TaskResult<>(null, error, false);
//     }
// 
//     public static <R, E extends Exception> TaskResult<R, E> newCanceledResult() {
//         return new TaskResult<>(null, null, true);
//     }
// 
//     TaskResult(R result, E error, boolean canceled) {
//         mResult = result;
//         mError = error;
//         mCanceled = canceled;
//     }
// 
//     public R getResult() {
//         return mResult;
//     }
// 
//     public E getError() {
//         return mError;
//     }
// 
//     public boolean isSuccess() {
//         return !mCanceled && mError == null;
//     }
// 
//     public boolean isCanceled() {
//         return mCanceled;
//     }
// }


import java.io.IOException;
import cat.ppicas.cleanarch.model.City;
import cat.ppicas.cleanarch.repository.CityRepository;
import cat.ppicas.framework.task.Task;
import cat.ppicas.framework.task.TaskResult;
import retrofit.RetrofitError;
/*
 * Copyright (C) 2015 Pau Picas Sans <pau.picas@gmail.com>
 *
 * 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 cat.ppicas.cleanarch.task;



public class GetCityTask implements Task<City, IOException> {

    private String mId;

    private CityRepository mRepository;

// Path: core/src/main/java/cat/ppicas/cleanarch/model/City.java
// public class City {
// 
//     private String mId;
//     private String mName;
//     private String mCountry;
//     private CurrentWeatherPreview mCurrentWeatherPreview;
// 
//     public City(String id, String name, String country) {
//         mId = id;
//         mName = name;
//         mCountry = country;
//     }
// 
//     public City(String id, String name, String country,
//             CurrentWeatherPreview currentWeatherPreview) {
//         mId = id;
//         mName = name;
//         mCountry = country;
//         mCurrentWeatherPreview = currentWeatherPreview;
//     }
// 
//     public String getId() {
//         return mId;
//     }
// 
//     public String getName() {
//         return mName;
//     }
// 
//     public String getCountry() {
//         return mCountry;
//     }
// 
//     public CurrentWeatherPreview getCurrentWeatherPreview() {
//         return mCurrentWeatherPreview;
//     }
// }
// 
// Path: core/src/main/java/cat/ppicas/cleanarch/repository/CityRepository.java
// public interface CityRepository {
// 
//     City getCity(String cityId);
// 
//     List<City> findCity(String name);
// 
// }
// 
// Path: core/src/main/java/cat/ppicas/framework/task/Task.java
// public interface Task<R, E extends Exception> {
// 
//     TaskResult<R, E> execute();
// 
// }
// 
// Path: core/src/main/java/cat/ppicas/framework/task/TaskResult.java
// public class TaskResult<R, E extends Exception> {
// 
//     private final R mResult;
// 
//     private final E mError;
// 
//     private final boolean mCanceled;
// 
//     public static <R, E extends Exception> TaskResult<R, E> newSuccessResult(R result) {
//         return new TaskResult<>(result, null, false);
//     }
// 
//     public static <R, E extends Exception> TaskResult<R, E> newErrorResult(E error) {
//         return new TaskResult<>(null, error, false);
//     }
// 
//     public static <R, E extends Exception> TaskResult<R, E> newCanceledResult() {
//         return new TaskResult<>(null, null, true);
//     }
// 
//     TaskResult(R result, E error, boolean canceled) {
//         mResult = result;
//         mError = error;
//         mCanceled = canceled;
//     }
// 
//     public R getResult() {
//         return mResult;
//     }
// 
//     public E getError() {
//         return mError;
//     }
// 
//     public boolean isSuccess() {
//         return !mCanceled && mError == null;
//     }
// 
//     public boolean isCanceled() {
//         return mCanceled;
//     }
// }


// Path: core/src/main/java/cat/ppicas/cleanarch/task/GetCityTask.java
import java.io.IOException;
import cat.ppicas.cleanarch.model.City;
import cat.ppicas.cleanarch.repository.CityRepository;
import cat.ppicas.framework.task.Task;
import cat.ppicas.framework.task.TaskResult;
import retrofit.RetrofitError;

/*
 * Copyright (C) 2015 Pau Picas Sans <pau.picas@gmail.com>
 *
 * 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 cat.ppicas.cleanarch.task;



public class GetCityTask implements Task<City, IOException> {

    private String mId;

    private CityRepository mRepository;

    public GetCityTask(CityRepository repository, String id) {