Skip to content

Commit

Permalink
Merge pull request #7 from MBenincasa/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
MBenincasa authored Sep 18, 2024
2 parents c33274f + fa8cb20 commit e6b3fde
Show file tree
Hide file tree
Showing 37 changed files with 989 additions and 1,003 deletions.
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,17 @@

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

## [0.2.0] - 2024-09-18

### Added
- **Daily Forecast (16 days)**: Access detailed weather forecasts at daily intervals for the next 16 days.

### Changed
- **3-hour Forecast (5 days)**: Renamed methods and classes.

### Removed
- Unnecessary setters within DTOs have been removed.

## [0.1.0] - 2024-09-03

### Added
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ The OpenWeatherMap Java Client Library is a robust and easy-to-use Java library
## Features
- Current Weather
- 3-hour Forecast 5 days
- Daily Forecast 16 days
- Air Pollution API
- Geocoding API

Expand All @@ -38,7 +39,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.1.0</version>
<version>0.2.0</version>
</dependency>
```

Expand Down
390 changes: 390 additions & 0 deletions docs/RELEASE_0.2.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.1.0</version>
<version>0.2.0</version>

<properties>
<maven.compiler.source>17</maven.compiler.source>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
import io.github.mbenincasa.javaopenweathermapclient.request.airPollution.HistoricalAirPollutionRequest;
import io.github.mbenincasa.javaopenweathermapclient.request.currentWeather.CurrentWeatherRequest;
import io.github.mbenincasa.javaopenweathermapclient.request.geocoding.GeocodingRequest;
import io.github.mbenincasa.javaopenweathermapclient.request.weatherForecast.FiveDayWeatherForecastRequest;
import io.github.mbenincasa.javaopenweathermapclient.request.weatherForecast.DailyWeatherForecastRequest;
import io.github.mbenincasa.javaopenweathermapclient.request.weatherForecast.FiveDaysWeatherForecastRequest;

public class DefaultOpenWeatherMapClient implements OpenWeatherMapClient {

Expand All @@ -21,8 +22,13 @@ public CurrentWeatherRequest currentWeather() {
}

@Override
public FiveDayWeatherForecastRequest fiveDayWeatherForecast() {
return new FiveDayWeatherForecastRequest(this.apiKey);
public FiveDaysWeatherForecastRequest fiveDaysWeatherForecast() {
return new FiveDaysWeatherForecastRequest(this.apiKey);
}

@Override
public DailyWeatherForecastRequest dailyWeatherForecast() {
return new DailyWeatherForecastRequest(this.apiKey);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,16 @@
import io.github.mbenincasa.javaopenweathermapclient.request.airPollution.HistoricalAirPollutionRequest;
import io.github.mbenincasa.javaopenweathermapclient.request.currentWeather.CurrentWeatherRequest;
import io.github.mbenincasa.javaopenweathermapclient.request.geocoding.GeocodingRequest;
import io.github.mbenincasa.javaopenweathermapclient.request.weatherForecast.FiveDayWeatherForecastRequest;
import io.github.mbenincasa.javaopenweathermapclient.request.weatherForecast.DailyWeatherForecastRequest;
import io.github.mbenincasa.javaopenweathermapclient.request.weatherForecast.FiveDaysWeatherForecastRequest;

public interface OpenWeatherMapClient {

CurrentWeatherRequest currentWeather();

FiveDayWeatherForecastRequest fiveDayWeatherForecast();
FiveDaysWeatherForecastRequest fiveDaysWeatherForecast();

DailyWeatherForecastRequest dailyWeatherForecast();

CurrentAirPollutionRequest currentAirPollution();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,10 @@ public Coord getCoord() {
return coord;
}

public void setCoord(Coord coord) {
this.coord = coord;
}

public List<AirPollutionList> getList() {
return list;
}

public void setList(List<AirPollutionList> list) {
this.list = list;
}

@Override
public String toString() {
return "AirPollutionDTO{" +
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,122 +50,62 @@ public Coord getCoord() {
return coord;
}

public void setCoord(Coord coord) {
this.coord = coord;
}

public List<Weather> getWeather() {
return weather;
}

public void setWeather(List<Weather> weather) {
this.weather = weather;
}

public String getBase() {
return base;
}

public void setBase(String base) {
this.base = base;
}

public Main getMain() {
return main;
}

public void setMain(Main main) {
this.main = main;
}

public Integer getVisibility() {
return visibility;
}

public void setVisibility(Integer visibility) {
this.visibility = visibility;
}

public Wind getWind() {
return wind;
}

public void setWind(Wind wind) {
this.wind = wind;
}

public Rain getRain() {
return rain;
}

public void setRain(Rain rain) {
this.rain = rain;
}

public Snow getSnow() {
return snow;
}

public void setSnow(Snow snow) {
this.snow = snow;
}

public Clouds getClouds() {
return clouds;
}

public void setClouds(Clouds clouds) {
this.clouds = clouds;
}

public Integer getDt() {
return dt;
}

public void setDt(Integer dt) {
this.dt = dt;
}

public Sys getSys() {
return sys;
}

public void setSys(Sys sys) {
this.sys = sys;
}

public Integer getTimezone() {
return timezone;
}

public void setTimezone(Integer timezone) {
this.timezone = timezone;
}

public Integer getId() {
return id;
}

public void setId(Integer id) {
this.id = id;
}

public String getName() {
return name;
}

public void setName(String name) {
this.name = name;
}

public Integer getCod() {
return cod;
}

public void setCod(Integer cod) {
this.cod = cod;
}

@Override
public String toString() {
return "CurrentWeatherDTO{" +
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
package io.github.mbenincasa.javaopenweathermapclient.dto;

import io.github.mbenincasa.javaopenweathermapclient.dto.dailyWeatherForecast.City;
import io.github.mbenincasa.javaopenweathermapclient.dto.dailyWeatherForecast.ForecastList;

import java.util.List;

public class DailyWeatherForecastDTO {

private String cod;
private Integer message;
private Integer cnt;
private City city;
private List<ForecastList> list;

public DailyWeatherForecastDTO() {
}

public DailyWeatherForecastDTO(String cod, Integer message, Integer cnt, City city, List<ForecastList> list) {
this.cod = cod;
this.message = message;
this.cnt = cnt;
this.city = city;
this.list = list;
}

public String getCod() {
return cod;
}

public Integer getMessage() {
return message;
}

public Integer getCnt() {
return cnt;
}

public City getCity() {
return city;
}

public List<ForecastList> getList() {
return list;
}

@Override
public String toString() {
return "DailyWeatherForecastDTO{" +
"cod='" + cod + '\'' +
", message=" + message +
", cnt=" + cnt +
", city=" + city +
", list=" + list +
'}';
}
}
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
package io.github.mbenincasa.javaopenweathermapclient.dto;

import io.github.mbenincasa.javaopenweathermapclient.dto.weatherForecast.City;
import io.github.mbenincasa.javaopenweathermapclient.dto.weatherForecast.ForecastList;
import io.github.mbenincasa.javaopenweathermapclient.dto.fiveDaysWeatherForecast.City;
import io.github.mbenincasa.javaopenweathermapclient.dto.fiveDaysWeatherForecast.ForecastList;

import java.util.List;

public class WeatherForecastDTO {
public class FiveDaysWeatherForecastDTO {

private String cod;
private Integer message;
private Integer cnt;
private List<ForecastList> list;
private City city;

public WeatherForecastDTO() {
public FiveDaysWeatherForecastDTO() {
}

public WeatherForecastDTO(String cod, Integer message, Integer cnt, List<ForecastList> list, City city) {
public FiveDaysWeatherForecastDTO(String cod, Integer message, Integer cnt, List<ForecastList> list, City city) {
this.cod = cod;
this.message = message;
this.cnt = cnt;
Expand All @@ -28,42 +28,22 @@ public String getCod() {
return cod;
}

public void setCod(String cod) {
this.cod = cod;
}

public Integer getMessage() {
return message;
}

public void setMessage(Integer message) {
this.message = message;
}

public Integer getCnt() {
return cnt;
}

public void setCnt(Integer cnt) {
this.cnt = cnt;
}

public List<ForecastList> getList() {
return list;
}

public void setList(List<ForecastList> list) {
this.list = list;
}

public City getCity() {
return city;
}

public void setCity(City city) {
this.city = city;
}

@Override
public String toString() {
return "WeatherForecastDTO{" +
Expand Down
Loading

0 comments on commit e6b3fde

Please sign in to comment.