diff --git a/docs/Release_1.1.md b/docs/Release_1.1.md index 33306a3..4d1394f 100644 --- a/docs/Release_1.1.md +++ b/docs/Release_1.1.md @@ -258,9 +258,9 @@ Available requests: | `getHumidity()` | Returns *humidity* percentage information. | | `getWindSpeed()` | Returns wind's speed. | | `getWindDegrees()` | Returns wind's degree. | -| `getWindUnit()` | Returns wind's unitSystem. | +| `getWindUnit()` | Returns wind's unit. | | `getPressure()` | Returns pressure value. | -| `getPressureUnit()` | Returns pressure's unitSystem. | +| `getPressureUnit()` | Returns pressure's unit. | | `toString()` | Returns pretty string for the whole available forecast information. | #### UV Index diff --git a/docs/Release_1.2.md b/docs/Release_1.2.md index 162cd25..cd7a79d 100644 --- a/docs/Release_1.2.md +++ b/docs/Release_1.2.md @@ -258,9 +258,9 @@ Available requests: | `getHumidity()` | Returns *humidity* percentage information. | | `getWindSpeed()` | Returns wind's speed. | | `getWindDegrees()` | Returns wind's degree. | -| `getWindUnit()` | Returns wind's unitSystem. | +| `getWindUnit()` | Returns wind's unit. | | `getPressure()` | Returns pressure value. | -| `getPressureUnit()` | Returns pressure's unitSystem. | +| `getPressureUnit()` | Returns pressure's unit. | | `toString()` | Returns pretty string for the whole available forecast information. | #### UV Index diff --git a/docs/SNAPSHOT.md b/docs/SNAPSHOT.md index 13db16a..5dedd3a 100644 --- a/docs/SNAPSHOT.md +++ b/docs/SNAPSHOT.md @@ -171,5 +171,4 @@ Location: Minsk(BY), Weather: слегка облачно, 20.0 ℃, 1019.0 hPa, ### Dependencies * com.fasterxml.jackson.core:jackson-databind:2.9.9 * org.slf4j:slf4j-api:1.7.26 (*compile*) -* org.jetbrains:annotations:17.0.0 (*compile*) * junit:junit:4.12 (*test*) \ No newline at end of file diff --git a/pom.xml b/pom.xml index bbb4845..33119ef 100644 --- a/pom.xml +++ b/pom.xml @@ -165,12 +165,6 @@ 1.7.26 compile - - org.jetbrains - annotations - 17.0.0 - compile - junit diff --git a/src/main/java/com/github/prominence/openweathermap/api/impl/CurrentWeatherResponseMapper.java b/src/main/java/com/github/prominence/openweathermap/api/impl/CurrentWeatherResponseMapper.java index 0c7caad..54e8fca 100644 --- a/src/main/java/com/github/prominence/openweathermap/api/impl/CurrentWeatherResponseMapper.java +++ b/src/main/java/com/github/prominence/openweathermap/api/impl/CurrentWeatherResponseMapper.java @@ -40,41 +40,41 @@ import java.util.TimeZone; * Official API response documentation: * Parameters: * --- coord - * |- coord.lon City geo location, longitude - * |- coord.lat City geo location, latitude + * |- coord.lon City geo location, longitude + * |- coord.lat City geo location, latitude * --- weather (more info Weather condition codes) - * |- weather.id Weather condition id - * |- weather.main Group of weather parameters (Rain, Snow, Extreme etc.) - * |- weather.description Weather condition within the group - * |- weather.icon Weather icon id + * |- weather.id Weather condition id + * |- weather.main Group of weather parameters (Rain, Snow, Extreme etc.) + * |- weather.description Weather condition within the group + * |- weather.icon Weather icon id * --- base Internal parameter * --- main - * |- main.temp Temperature. UnitSystem Default: Kelvin, Metric: Celsius, Imperial: Fahrenheit. - * |- main.pressure Atmospheric pressure (on the sea level, if there is no sea_level or grnd_level data), hPa - * |- main.humidity Humidity, % - * |- main.temp_min Minimum temperature at the moment. This is deviation from current temp that is possible for large cities and megalopolises geographically expanded (use these parameter optionally). UnitSystem Default: Kelvin, Metric: Celsius, Imperial: Fahrenheit. - * |- main.temp_max Maximum temperature at the moment. This is deviation from current temp that is possible for large cities and megalopolises geographically expanded (use these parameter optionally). UnitSystem Default: Kelvin, Metric: Celsius, Imperial: Fahrenheit. - * |- main.sea_level Atmospheric pressure on the sea level, hPa - * |- main.grnd_level Atmospheric pressure on the ground level, hPa + * |- main.temp Temperature. UnitSystem Default: Kelvin, Metric: Celsius, Imperial: Fahrenheit. + * |- main.pressure Atmospheric pressure (on the sea level, if there is no sea_level or grnd_level data), hPa + * |- main.humidity Humidity, % + * |- main.temp_min Minimum temperature at the moment. This is deviation from current temp that is possible for large cities and megalopolises geographically expanded (use these parameter optionally). UnitSystem Default: Kelvin, Metric: Celsius, Imperial: Fahrenheit. + * |- main.temp_max Maximum temperature at the moment. This is deviation from current temp that is possible for large cities and megalopolises geographically expanded (use these parameter optionally). UnitSystem Default: Kelvin, Metric: Celsius, Imperial: Fahrenheit. + * |- main.sea_level Atmospheric pressure on the sea level, hPa + * |- main.grnd_level Atmospheric pressure on the ground level, hPa * --- wind - * |- wind.speed Wind speed. UnitSystem Default: meter/sec, Metric: meter/sec, Imperial: miles/hour. - * |- wind.deg Wind direction, degrees (meteorological) + * |- wind.speed Wind speed. UnitSystem Default: meter/sec, Metric: meter/sec, Imperial: miles/hour. + * |- wind.deg Wind direction, degrees (meteorological) * --- clouds - * |- clouds.all Cloudiness, % + * |- clouds.all Cloudiness, % * --- rain - * |- rain.1h Rain volume for the last 1 hour, mm - * |- rain.3h Rain volume for the last 3 hours, mm + * |- rain.1h Rain volume for the last 1 hour, mm + * |- rain.3h Rain volume for the last 3 hours, mm * --- snow - * |- snow.1h Snow volume for the last 1 hour, mm - * |- snow.3h Snow volume for the last 3 hours, mm + * |- snow.1h Snow volume for the last 1 hour, mm + * |- snow.3h Snow volume for the last 3 hours, mm * --- dt Time of data calculation, unix, UTC * --- sys - * |- sys.type Internal parameter - * |- sys.id Internal parameter - * |- sys.message Internal parameter - * |- sys.country Country code (GB, JP etc.) - * |- sys.sunrise Sunrise time, unix, UTC - * |- sys.sunset Sunset time, unix, UTC + * |- sys.type Internal parameter + * |- sys.id Internal parameter + * |- sys.message Internal parameter + * |- sys.country Country code (GB, JP etc.) + * |- sys.sunrise Sunrise time, unix, UTC + * |- sys.sunset Sunset time, unix, UTC * --- id City ID * --- name City name * --- cod Internal parameter diff --git a/src/main/java/com/github/prominence/openweathermap/api/utils/RequestUtils.java b/src/main/java/com/github/prominence/openweathermap/api/utils/RequestUtils.java index 141ed87..b780212 100644 --- a/src/main/java/com/github/prominence/openweathermap/api/utils/RequestUtils.java +++ b/src/main/java/com/github/prominence/openweathermap/api/utils/RequestUtils.java @@ -24,7 +24,6 @@ package com.github.prominence.openweathermap.api.utils; import com.github.prominence.openweathermap.api.exception.DataNotFoundException; import com.github.prominence.openweathermap.api.exception.InvalidAuthTokenException; -import org.jetbrains.annotations.NotNull; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -56,8 +55,7 @@ public final class RequestUtils { * @throws DataNotFoundException in case if there is no any data for requested location(s) or request is invalid. * @throws IllegalStateException in case of unexpected response or error. */ - @NotNull - private static InputStream executeRequest(@NotNull URL requestUrl) { + private static InputStream executeRequest(URL requestUrl) { InputStream resultStream; try { @@ -91,8 +89,7 @@ public final class RequestUtils { * @return response from the request in String representation. * @throws IllegalArgumentException in case if provided parameter isn't a valid url for {@link URL} instance. */ - @NotNull - public static String getResponse(@NotNull String url) { + public static String getResponse(String url) { URL requestUrl; try { requestUrl = new URL(url); @@ -112,8 +109,7 @@ public final class RequestUtils { * @return converted InputStream content. * @throws IllegalArgumentException in case if input stream is unable to be read. */ - @NotNull - private static String convertInputStreamToString(@NotNull InputStream inputStream) { + private static String convertInputStreamToString(InputStream inputStream) { StringBuilder result = new StringBuilder(); try (BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream, StandardCharsets.UTF_8))) {