Moved mappers into separate package.

This commit is contained in:
Prominence 2022-04-14 20:28:23 +03:00
parent 2a531dd683
commit 13b20fc7e9
22 changed files with 42 additions and 39 deletions

View File

@ -1,28 +1,26 @@
/* /*
* Copyright (c) 2022 Alexey Zinchenko
* *
* * Copyright (c) 2021 Alexey Zinchenko * Permission is hereby granted, free of charge, to any person obtaining a copy
* * * of this software and associated documentation files (the "Software"), to deal
* * Permission is hereby granted, free of charge, to any person obtaining a copy * in the Software without restriction, including without limitation the rights
* * of this software and associated documentation files (the "Software"), to deal * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* * in the Software without restriction, including without limitation the rights * copies of the Software, and to permit persons to whom the Software is
* * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * furnished to do so, subject to the following conditions:
* * copies of the Software, and to permit persons to whom the Software is
* * furnished to do so, subject to the following conditions:
* *
* * The above copyright notice and this permission notice shall be included in all
* * copies or substantial portions of the Software.
* *
* * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* * SOFTWARE.
* *
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/ */
package com.github.prominence.openweathermap.api.request.air.pollution; package com.github.prominence.openweathermap.api.mapper;
import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.JsonNode;

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2021 Alexey Zinchenko * Copyright (c) 2022 Alexey Zinchenko
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * of this software and associated documentation files (the "Software"), to deal
@ -20,7 +20,7 @@
* SOFTWARE. * SOFTWARE.
*/ */
package com.github.prominence.openweathermap.api.request.weather; package com.github.prominence.openweathermap.api.mapper;
import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.JsonNode;

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2021 Alexey Zinchenko * Copyright (c) 2022 Alexey Zinchenko
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * of this software and associated documentation files (the "Software"), to deal
@ -20,7 +20,7 @@
* SOFTWARE. * SOFTWARE.
*/ */
package com.github.prominence.openweathermap.api.request.forecast.free; package com.github.prominence.openweathermap.api.mapper;
import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.JsonNode;

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2021 Alexey Zinchenko * Copyright (c) 2022 Alexey Zinchenko
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * of this software and associated documentation files (the "Software"), to deal
@ -20,7 +20,7 @@
* SOFTWARE. * SOFTWARE.
*/ */
package com.github.prominence.openweathermap.api.request.onecall; package com.github.prominence.openweathermap.api.mapper;
import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.JsonNode;

View File

@ -24,6 +24,7 @@
package com.github.prominence.openweathermap.api.request.air.pollution; package com.github.prominence.openweathermap.api.request.air.pollution;
import com.github.prominence.openweathermap.api.mapper.AirPollutionResponseMapper;
import com.github.prominence.openweathermap.api.model.air.pollution.AirPollutionDetails; import com.github.prominence.openweathermap.api.model.air.pollution.AirPollutionDetails;
import com.github.prominence.openweathermap.api.request.RequestUrlBuilder; import com.github.prominence.openweathermap.api.request.RequestUrlBuilder;
import com.github.prominence.openweathermap.api.utils.RequestUtils; import com.github.prominence.openweathermap.api.utils.RequestUtils;

View File

@ -24,6 +24,7 @@
package com.github.prominence.openweathermap.api.request.air.pollution; package com.github.prominence.openweathermap.api.request.air.pollution;
import com.github.prominence.openweathermap.api.mapper.AirPollutionResponseMapper;
import com.github.prominence.openweathermap.api.model.air.pollution.AirPollutionDetails; import com.github.prominence.openweathermap.api.model.air.pollution.AirPollutionDetails;
import com.github.prominence.openweathermap.api.request.RequestUrlBuilder; import com.github.prominence.openweathermap.api.request.RequestUrlBuilder;
import com.github.prominence.openweathermap.api.utils.RequestUtils; import com.github.prominence.openweathermap.api.utils.RequestUtils;

View File

@ -23,6 +23,7 @@
package com.github.prominence.openweathermap.api.request.forecast.free; package com.github.prominence.openweathermap.api.request.forecast.free;
import com.github.prominence.openweathermap.api.enums.UnitSystem; import com.github.prominence.openweathermap.api.enums.UnitSystem;
import com.github.prominence.openweathermap.api.mapper.FiveDayThreeHourStepForecastResponseMapper;
import com.github.prominence.openweathermap.api.model.forecast.Forecast; import com.github.prominence.openweathermap.api.model.forecast.Forecast;
import com.github.prominence.openweathermap.api.request.RequestUrlBuilder; import com.github.prominence.openweathermap.api.request.RequestUrlBuilder;
import com.github.prominence.openweathermap.api.utils.RequestUtils; import com.github.prominence.openweathermap.api.utils.RequestUtils;

View File

@ -23,6 +23,7 @@
package com.github.prominence.openweathermap.api.request.forecast.free; package com.github.prominence.openweathermap.api.request.forecast.free;
import com.github.prominence.openweathermap.api.enums.UnitSystem; import com.github.prominence.openweathermap.api.enums.UnitSystem;
import com.github.prominence.openweathermap.api.mapper.FiveDayThreeHourStepForecastResponseMapper;
import com.github.prominence.openweathermap.api.model.forecast.Forecast; import com.github.prominence.openweathermap.api.model.forecast.Forecast;
import com.github.prominence.openweathermap.api.request.RequestUrlBuilder; import com.github.prominence.openweathermap.api.request.RequestUrlBuilder;
import com.github.prominence.openweathermap.api.utils.RequestUtils; import com.github.prominence.openweathermap.api.utils.RequestUtils;

View File

@ -25,7 +25,7 @@ package com.github.prominence.openweathermap.api.request.onecall.current;
import com.github.prominence.openweathermap.api.enums.UnitSystem; import com.github.prominence.openweathermap.api.enums.UnitSystem;
import com.github.prominence.openweathermap.api.model.onecall.current.CurrentWeatherData; import com.github.prominence.openweathermap.api.model.onecall.current.CurrentWeatherData;
import com.github.prominence.openweathermap.api.request.RequestUrlBuilder; import com.github.prominence.openweathermap.api.request.RequestUrlBuilder;
import com.github.prominence.openweathermap.api.request.onecall.OneCallWeatherResponseMapper; import com.github.prominence.openweathermap.api.mapper.OneCallWeatherResponseMapper;
import com.github.prominence.openweathermap.api.utils.RequestUtils; import com.github.prominence.openweathermap.api.utils.RequestUtils;
import java.util.concurrent.CompletableFuture; import java.util.concurrent.CompletableFuture;

View File

@ -25,7 +25,7 @@ package com.github.prominence.openweathermap.api.request.onecall.current;
import com.github.prominence.openweathermap.api.enums.UnitSystem; import com.github.prominence.openweathermap.api.enums.UnitSystem;
import com.github.prominence.openweathermap.api.model.onecall.current.CurrentWeatherData; import com.github.prominence.openweathermap.api.model.onecall.current.CurrentWeatherData;
import com.github.prominence.openweathermap.api.request.RequestUrlBuilder; import com.github.prominence.openweathermap.api.request.RequestUrlBuilder;
import com.github.prominence.openweathermap.api.request.onecall.OneCallWeatherResponseMapper; import com.github.prominence.openweathermap.api.mapper.OneCallWeatherResponseMapper;
import com.github.prominence.openweathermap.api.utils.RequestUtils; import com.github.prominence.openweathermap.api.utils.RequestUtils;
/** /**

View File

@ -25,7 +25,7 @@ package com.github.prominence.openweathermap.api.request.onecall.historical;
import com.github.prominence.openweathermap.api.enums.UnitSystem; import com.github.prominence.openweathermap.api.enums.UnitSystem;
import com.github.prominence.openweathermap.api.model.onecall.historical.HistoricalWeatherData; import com.github.prominence.openweathermap.api.model.onecall.historical.HistoricalWeatherData;
import com.github.prominence.openweathermap.api.request.RequestUrlBuilder; import com.github.prominence.openweathermap.api.request.RequestUrlBuilder;
import com.github.prominence.openweathermap.api.request.onecall.OneCallWeatherResponseMapper; import com.github.prominence.openweathermap.api.mapper.OneCallWeatherResponseMapper;
import com.github.prominence.openweathermap.api.utils.RequestUtils; import com.github.prominence.openweathermap.api.utils.RequestUtils;
import java.util.concurrent.CompletableFuture; import java.util.concurrent.CompletableFuture;

View File

@ -25,7 +25,7 @@ package com.github.prominence.openweathermap.api.request.onecall.historical;
import com.github.prominence.openweathermap.api.enums.UnitSystem; import com.github.prominence.openweathermap.api.enums.UnitSystem;
import com.github.prominence.openweathermap.api.model.onecall.historical.HistoricalWeatherData; import com.github.prominence.openweathermap.api.model.onecall.historical.HistoricalWeatherData;
import com.github.prominence.openweathermap.api.request.RequestUrlBuilder; import com.github.prominence.openweathermap.api.request.RequestUrlBuilder;
import com.github.prominence.openweathermap.api.request.onecall.OneCallWeatherResponseMapper; import com.github.prominence.openweathermap.api.mapper.OneCallWeatherResponseMapper;
import com.github.prominence.openweathermap.api.utils.RequestUtils; import com.github.prominence.openweathermap.api.utils.RequestUtils;
/** /**

View File

@ -25,7 +25,7 @@ package com.github.prominence.openweathermap.api.request.weather.multiple;
import com.github.prominence.openweathermap.api.enums.ResponseType; import com.github.prominence.openweathermap.api.enums.ResponseType;
import com.github.prominence.openweathermap.api.model.weather.Weather; import com.github.prominence.openweathermap.api.model.weather.Weather;
import com.github.prominence.openweathermap.api.request.RequestSettings; import com.github.prominence.openweathermap.api.request.RequestSettings;
import com.github.prominence.openweathermap.api.request.weather.CurrentWeatherResponseMapper; import com.github.prominence.openweathermap.api.mapper.CurrentWeatherResponseMapper;
import com.github.prominence.openweathermap.api.utils.RequestUtils; import com.github.prominence.openweathermap.api.utils.RequestUtils;
import java.util.List; import java.util.List;

View File

@ -25,7 +25,7 @@ package com.github.prominence.openweathermap.api.request.weather.multiple;
import com.github.prominence.openweathermap.api.enums.ResponseType; import com.github.prominence.openweathermap.api.enums.ResponseType;
import com.github.prominence.openweathermap.api.model.weather.Weather; import com.github.prominence.openweathermap.api.model.weather.Weather;
import com.github.prominence.openweathermap.api.request.RequestSettings; import com.github.prominence.openweathermap.api.request.RequestSettings;
import com.github.prominence.openweathermap.api.request.weather.CurrentWeatherResponseMapper; import com.github.prominence.openweathermap.api.mapper.CurrentWeatherResponseMapper;
import com.github.prominence.openweathermap.api.utils.RequestUtils; import com.github.prominence.openweathermap.api.utils.RequestUtils;
import java.util.List; import java.util.List;

View File

@ -24,7 +24,7 @@ package com.github.prominence.openweathermap.api.request.weather.multiple;
import com.github.prominence.openweathermap.api.model.weather.Weather; import com.github.prominence.openweathermap.api.model.weather.Weather;
import com.github.prominence.openweathermap.api.request.RequestSettings; import com.github.prominence.openweathermap.api.request.RequestSettings;
import com.github.prominence.openweathermap.api.request.weather.CurrentWeatherResponseMapper; import com.github.prominence.openweathermap.api.mapper.CurrentWeatherResponseMapper;
import com.github.prominence.openweathermap.api.utils.RequestUtils; import com.github.prominence.openweathermap.api.utils.RequestUtils;
import java.util.List; import java.util.List;

View File

@ -24,7 +24,7 @@ package com.github.prominence.openweathermap.api.request.weather.multiple;
import com.github.prominence.openweathermap.api.model.weather.Weather; import com.github.prominence.openweathermap.api.model.weather.Weather;
import com.github.prominence.openweathermap.api.request.RequestSettings; import com.github.prominence.openweathermap.api.request.RequestSettings;
import com.github.prominence.openweathermap.api.request.weather.CurrentWeatherResponseMapper; import com.github.prominence.openweathermap.api.mapper.CurrentWeatherResponseMapper;
import com.github.prominence.openweathermap.api.utils.RequestUtils; import com.github.prominence.openweathermap.api.utils.RequestUtils;
import java.util.List; import java.util.List;

View File

@ -22,12 +22,9 @@
package com.github.prominence.openweathermap.api.request.weather.single; package com.github.prominence.openweathermap.api.request.weather.single;
import com.github.prominence.openweathermap.api.conf.TimeoutSettings;
import com.github.prominence.openweathermap.api.enums.ResponseType; import com.github.prominence.openweathermap.api.enums.ResponseType;
import com.github.prominence.openweathermap.api.request.RequestSettings; import com.github.prominence.openweathermap.api.request.RequestSettings;
import com.github.prominence.openweathermap.api.request.RequestUrlBuilder; import com.github.prominence.openweathermap.api.mapper.CurrentWeatherResponseMapper;
import com.github.prominence.openweathermap.api.request.weather.CurrentWeatherResponseMapper;
import com.github.prominence.openweathermap.api.enums.UnitSystem;
import com.github.prominence.openweathermap.api.model.weather.Weather; import com.github.prominence.openweathermap.api.model.weather.Weather;
import com.github.prominence.openweathermap.api.utils.RequestUtils; import com.github.prominence.openweathermap.api.utils.RequestUtils;

View File

@ -25,7 +25,7 @@ package com.github.prominence.openweathermap.api.request.weather.single;
import com.github.prominence.openweathermap.api.enums.ResponseType; import com.github.prominence.openweathermap.api.enums.ResponseType;
import com.github.prominence.openweathermap.api.model.weather.Weather; import com.github.prominence.openweathermap.api.model.weather.Weather;
import com.github.prominence.openweathermap.api.request.RequestSettings; import com.github.prominence.openweathermap.api.request.RequestSettings;
import com.github.prominence.openweathermap.api.request.weather.CurrentWeatherResponseMapper; import com.github.prominence.openweathermap.api.mapper.CurrentWeatherResponseMapper;
import com.github.prominence.openweathermap.api.utils.RequestUtils; import com.github.prominence.openweathermap.api.utils.RequestUtils;
/** /**

View File

@ -24,6 +24,7 @@
package com.github.prominence.openweathermap.api.request.air.pollution; package com.github.prominence.openweathermap.api.request.air.pollution;
import com.github.prominence.openweathermap.api.mapper.AirPollutionResponseMapper;
import com.github.prominence.openweathermap.api.model.air.pollution.AirPollutionDetails; import com.github.prominence.openweathermap.api.model.air.pollution.AirPollutionDetails;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;

View File

@ -23,6 +23,7 @@
package com.github.prominence.openweathermap.api.request.forecast.free; package com.github.prominence.openweathermap.api.request.forecast.free;
import com.github.prominence.openweathermap.api.enums.UnitSystem; import com.github.prominence.openweathermap.api.enums.UnitSystem;
import com.github.prominence.openweathermap.api.mapper.FiveDayThreeHourStepForecastResponseMapper;
import com.github.prominence.openweathermap.api.model.forecast.Forecast; import com.github.prominence.openweathermap.api.model.forecast.Forecast;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;

View File

@ -23,6 +23,7 @@
package com.github.prominence.openweathermap.api.request.onecall; package com.github.prominence.openweathermap.api.request.onecall;
import com.github.prominence.openweathermap.api.enums.UnitSystem; import com.github.prominence.openweathermap.api.enums.UnitSystem;
import com.github.prominence.openweathermap.api.mapper.OneCallWeatherResponseMapper;
import com.github.prominence.openweathermap.api.model.onecall.current.CurrentWeatherData; import com.github.prominence.openweathermap.api.model.onecall.current.CurrentWeatherData;
import com.github.prominence.openweathermap.api.model.onecall.historical.HistoricalWeatherData; import com.github.prominence.openweathermap.api.model.onecall.historical.HistoricalWeatherData;
import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Assertions;

View File

@ -23,6 +23,7 @@
package com.github.prominence.openweathermap.api.request.weather; package com.github.prominence.openweathermap.api.request.weather;
import com.github.prominence.openweathermap.api.enums.UnitSystem; import com.github.prominence.openweathermap.api.enums.UnitSystem;
import com.github.prominence.openweathermap.api.mapper.CurrentWeatherResponseMapper;
import com.github.prominence.openweathermap.api.model.weather.Weather; import com.github.prominence.openweathermap.api.model.weather.Weather;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;