Skip to content

Commit

Permalink
Merge pull request #16 from MBenincasa/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
MBenincasa authored Nov 24, 2024
2 parents afec6f9 + 1b3def9 commit 9fad1f6
Show file tree
Hide file tree
Showing 29 changed files with 2,366 additions and 12 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@

All significant changes to this project will be documented in this file.

## [0.5.0] - 2024-11-24

### Added
- **One Call API 3.0**: Get essential weather data, short-term and long-term forecasts and aggregated weather data.

## [0.4.0] - 2024-10-29

### Added
Expand Down
30 changes: 19 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,24 @@ The OpenWeatherMap Java Client Library is a robust and easy-to-use Java library
- [Donations](#donations)

## Features
- Current Weather
- 3-hour Forecast 5 days
- Hourly Forecast 4 days
- Daily Forecast 16 days
- Climatic Forecast 30 days
- Basic weather maps
- Advanced weather maps
- Historical maps
- Air Pollution API
- Geocoding API
- **One Call API 3.0**
- Current and forecasts weather data
- Weather data for timestamp
- Daily Aggregation
- Weather overview
- **Current & Forecast weather data collection**
- Current Weather
- 3-hour Forecast 5 days
- Hourly Forecast 4 days
- Daily Forecast 16 days
- Climatic Forecast 30 days
- **Maps collection**
- Basic weather maps
- Advanced weather maps
- Historical maps
- **Other weather API's collection**
- Air Pollution API
- Geocoding API

## Minimum Requirements
Java 17 or above.
Expand All @@ -44,7 +52,7 @@ To include this library in your Maven project, add the following dependency to y
<dependency>
<groupId>io.github.mbenincasa</groupId>
<artifactId>java-open-weather-map-client</artifactId>
<version>0.4.0</version>
<version>0.5.0</version>
</dependency>
```

Expand Down
718 changes: 718 additions & 0 deletions docs/RELEASE_0.5.0.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>io.github.mbenincasa</groupId>
<artifactId>java-open-weather-map-client</artifactId>
<version>0.4.0</version>
<version>0.5.0</version>

<properties>
<maven.compiler.source>17</maven.compiler.source>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import io.github.mbenincasa.javaopenweathermapclient.request.airPollution.AirPollutionRequest;
import io.github.mbenincasa.javaopenweathermapclient.request.currentWeather.CurrentWeatherRequest;
import io.github.mbenincasa.javaopenweathermapclient.request.geocoding.GeocodingRequest;
import io.github.mbenincasa.javaopenweathermapclient.request.oneCallApi.OneCallApiRequest;
import io.github.mbenincasa.javaopenweathermapclient.request.weatherForecast.ClimaticWeatherForecastRequest;
import io.github.mbenincasa.javaopenweathermapclient.request.weatherForecast.DailyWeatherForecastRequest;
import io.github.mbenincasa.javaopenweathermapclient.request.weatherForecast.FiveDaysWeatherForecastRequest;
Expand Down Expand Up @@ -62,4 +63,9 @@ public BasicWeatherMapRequest basicWeatherMap() {
public AdvancedWeatherMapRequest advancedWeatherMap() {
return new AdvancedWeatherMapRequest(this.apiKey);
}

@Override
public OneCallApiRequest oneCallApi() {
return new OneCallApiRequest(this.apiKey);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import io.github.mbenincasa.javaopenweathermapclient.request.airPollution.AirPollutionRequest;
import io.github.mbenincasa.javaopenweathermapclient.request.currentWeather.CurrentWeatherRequest;
import io.github.mbenincasa.javaopenweathermapclient.request.geocoding.GeocodingRequest;
import io.github.mbenincasa.javaopenweathermapclient.request.oneCallApi.OneCallApiRequest;
import io.github.mbenincasa.javaopenweathermapclient.request.weatherForecast.ClimaticWeatherForecastRequest;
import io.github.mbenincasa.javaopenweathermapclient.request.weatherForecast.DailyWeatherForecastRequest;
import io.github.mbenincasa.javaopenweathermapclient.request.weatherForecast.FiveDaysWeatherForecastRequest;
Expand All @@ -29,4 +30,6 @@ public interface OpenWeatherMapClient {
BasicWeatherMapRequest basicWeatherMap();

AdvancedWeatherMapRequest advancedWeatherMap();

OneCallApiRequest oneCallApi();
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
package io.github.mbenincasa.javaopenweathermapclient.dto;

import com.fasterxml.jackson.annotation.JsonProperty;
import io.github.mbenincasa.javaopenweathermapclient.dto.oneCallApi.currentAndForecasts.*;

import java.util.List;

public class OneCallApiCurrentAndForecastsDataDTO {

private Double lat;
private Double lon;
private String timezone;
@JsonProperty("timezone_offset")
private Integer timezoneOffset;
private Current current;
private List<Minutely> minutely;
private List<Hourly> hourly;
private List<Daily> daily;
private List<Alerts> alerts;

public OneCallApiCurrentAndForecastsDataDTO() {
}

public OneCallApiCurrentAndForecastsDataDTO(Double lat, Double lon, String timezone, Integer timezoneOffset, Current current, List<Minutely> minutely, List<Hourly> hourly, List<Daily> daily, List<Alerts> alerts) {
this.lat = lat;
this.lon = lon;
this.timezone = timezone;
this.timezoneOffset = timezoneOffset;
this.current = current;
this.minutely = minutely;
this.hourly = hourly;
this.daily = daily;
this.alerts = alerts;
}

public Double getLat() {
return lat;
}

public Double getLon() {
return lon;
}

public String getTimezone() {
return timezone;
}

public Integer getTimezoneOffset() {
return timezoneOffset;
}

public Current getCurrent() {
return current;
}

public List<Minutely> getMinutely() {
return minutely;
}

public List<Hourly> getHourly() {
return hourly;
}

public List<Daily> getDaily() {
return daily;
}

public List<Alerts> getAlerts() {
return alerts;
}

@Override
public String toString() {
return "OneCallApiCurrentAndForecastsDataDTO{" +
"lat=" + lat +
", lon=" + lon +
", timezone='" + timezone + '\'' +
", timezoneOffset=" + timezoneOffset +
", current=" + current +
", minutely=" + minutely +
", hourly=" + hourly +
", daily=" + daily +
", alerts=" + alerts +
'}';
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
package io.github.mbenincasa.javaopenweathermapclient.dto;

import com.fasterxml.jackson.annotation.JsonProperty;
import io.github.mbenincasa.javaopenweathermapclient.dto.oneCallApi.daySummary.*;

public class OneCallApiDaySummaryDTO {

private Double lat;
private Double lon;
private String tz;
private String date;
private String units;
@JsonProperty("cloud_cover")
private CloudCover cloudCover;
private Humidity humidity;
private Precipitation precipitation;
private Temperature temperature;
private Pressure pressure;
private Wind wind;

public OneCallApiDaySummaryDTO() {
}

public OneCallApiDaySummaryDTO(Double lat, Double lon, String tz, String date, String units, CloudCover cloudCover, Humidity humidity, Precipitation precipitation, Temperature temperature, Pressure pressure, Wind wind) {
this.lat = lat;
this.lon = lon;
this.tz = tz;
this.date = date;
this.units = units;
this.cloudCover = cloudCover;
this.humidity = humidity;
this.precipitation = precipitation;
this.temperature = temperature;
this.pressure = pressure;
this.wind = wind;
}

public Double getLat() {
return lat;
}

public Double getLon() {
return lon;
}

public String getTz() {
return tz;
}

public String getDate() {
return date;
}

public String getUnits() {
return units;
}

public CloudCover getCloudCover() {
return cloudCover;
}

public Humidity getHumidity() {
return humidity;
}

public Precipitation getPrecipitation() {
return precipitation;
}

public Temperature getTemperature() {
return temperature;
}

public Pressure getPressure() {
return pressure;
}

public Wind getWind() {
return wind;
}

@Override
public String toString() {
return "OneCallApiDaySummaryDTO{" +
"lat=" + lat +
", lon=" + lon +
", tz='" + tz + '\'' +
", date='" + date + '\'' +
", units='" + units + '\'' +
", cloudCover=" + cloudCover +
", humidity=" + humidity +
", precipitation=" + precipitation +
", temperature=" + temperature +
", pressure=" + pressure +
", wind=" + wind +
'}';
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
package io.github.mbenincasa.javaopenweathermapclient.dto;

import com.fasterxml.jackson.annotation.JsonProperty;

public class OneCallApiOverviewDTO {

private Double lat;
private Double lon;
private String tz;
private String date;
private String units;
@JsonProperty("weather_overview")
private String weatherOverview;

public OneCallApiOverviewDTO() {
}

public OneCallApiOverviewDTO(Double lat, Double lon, String tz, String date, String units, String weatherOverview) {
this.lat = lat;
this.lon = lon;
this.tz = tz;
this.date = date;
this.units = units;
this.weatherOverview = weatherOverview;
}

public Double getLat() {
return lat;
}

public Double getLon() {
return lon;
}

public String getTz() {
return tz;
}

public String getDate() {
return date;
}

public String getUnits() {
return units;
}

public String getWeatherOverview() {
return weatherOverview;
}

@Override
public String toString() {
return "OneCallApiOverviewDTO{" +
"lat=" + lat +
", lon=" + lon +
", tz='" + tz + '\'' +
", date='" + date + '\'' +
", units='" + units + '\'' +
", weatherOverview='" + weatherOverview + '\'' +
'}';
}
}
Loading

0 comments on commit 9fad1f6

Please sign in to comment.