@@ -0,0 +1,2629 @@
+/*%0A * Copyright (c) 2015 Ushahidi Inc%0A *%0A * This program is free software: you can redistribute it and/or modify it under%0A *  the terms of the GNU Affero General Public License as published by the Free%0A *  Software Foundation, either version 3 of the License, or (at your option)%0A *  any later version.%0A *%0A *  This program is distributed in the hope that it will be useful, but WITHOUT%0A *  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS%0A *  FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.%0A *%0A *  You should have received a copy of the GNU Affero General Public License%0A *  along with this program in the file LICENSE-AGPL. If not, see%0A *  https://www.gnu.org/licenses/agpl-3.0.html%0A */%0A%0Apackage com.ushahidi.android.data.entity.mapper;%0A%0Aimport com.ushahidi.android.data.entity.GeoJsonEntity;%0Aimport com.ushahidi.android.domain.entity.GeoJson;%0A%0Aimport java.util.ArrayList;%0Aimport java.util.List;%0A%0A/**%0A * @author Ushahidi Team %3Cteam@ushahidi.com%3E%0A */%0Apublic class GeoJsonEntityDataMapper %7B%0A%0A    /**%0A     * Maps %7B@link GeoJsonEntity%7D to %7B@link%0A     * GeoJson%7D%0A     *%0A     * @param geoJsonEntity The %7B@link GeoJson%7D to be%0A     *                      mapped%0A     * @return The %7B@link GeoJsonEntity%7D entity%0A     */%0A    public GeoJson map(GeoJsonEntity geoJsonEntity) %7B%0A        GeoJson geoJson = new GeoJson();%0A        if (geoJsonEntity != null) %7B%0A            geoJson._id = geoJsonEntity._id;%0A            geoJson.setGeoJson(geoJsonEntity.getGeoJson());%0A        %7D%0A        return geoJson;%0A    %7D%0A%0A    /**%0A     * Unmaps %7B@link GeoJson%7D from %7B@link%0A     * GeoJsonEntity%7D%0A     *%0A     * @param geoJson The %7B@link GeoJsonEntity%7D to be%0A     *                mapped%0A     * @return The %7B@link GeoJson%7D entity%0A     */%0A    public GeoJsonEntity map(GeoJson geoJson) %7B%0A        GeoJsonEntity geoJsonEntity = new GeoJsonEntity();%0A        if (geoJson != null) %7B%0A            geoJsonEntity._id = geoJson._id;%0A            geoJsonEntity.setGeoJson(geoJson.getGeoJson());%0A        %7D%0A        return geoJsonEntity;%0A    %7D%0A%0A    /**%0A     * Maps a list %7B@link GeoJsonEntity%7D into a list of %7B@link GeoJson%7D.%0A     *%0A     * @param geoJsonEntityList List to be mapped.%0A     * @return %7B@link GeoJson%7D%0A     */%0A    public List%3CGeoJson%3E map(List%3CGeoJsonEntity%3E geoJsonEntityList) %7B%0A        List%3CGeoJson%3E geoJsonList = new ArrayList%3C%3E();%0A        GeoJson geoJson;%0A        for (GeoJsonEntity geoJsonEntity : geoJsonEntityList) %7B%0A            geoJson = map(geoJsonEntity);%0A            if (geoJson != null) %7B%0A                geoJsonList.add(geoJson);%0A            %7D%0A        %7D%0A        return geoJsonList;%0A    %7D%0A%7D%0A

Add geojson data mapper