mirror of
https://github.com/Prominence/openweathermap-java-api.git
synced 2026-07-03 03:06:45 +03:00
Fixed docs. Removed 'annotations' dependency.
This commit is contained in:
+26
-26
@@ -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
|
||||
|
||||
@@ -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 <code>String</code> 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 <code>InputStream</code> 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))) {
|
||||
|
||||
Reference in New Issue
Block a user