Initial implementation of free-plan forecast retriever. Small refactoring.

This commit is contained in:
2021-03-21 02:32:39 +03:00
parent d63de824b3
commit ea39441e83
60 changed files with 697 additions and 526 deletions
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2019 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
@@ -22,9 +22,14 @@
package com.github.prominence.openweathermap.api;
import com.github.prominence.openweathermap.api.annotation.SubscriptionAvailability;
import com.github.prominence.openweathermap.api.request.forecast.free.FiveDayThreeHourStepForecastRequester;
import com.github.prominence.openweathermap.api.request.forecast.free.FiveDayThreeHourStepForecastRequesterImpl;
import com.github.prominence.openweathermap.api.request.weather.CurrentWeatherRequester;
import com.github.prominence.openweathermap.api.request.weather.CurrentWeatherRequesterImpl;
import static com.github.prominence.openweathermap.api.enums.SubscriptionPlan.*;
public class OpenWeatherMapClient {
private final String apiKey;
@@ -33,12 +38,19 @@ public class OpenWeatherMapClient {
this.apiKey = apiKey;
}
@SubscriptionAvailability(plans = ALL)
public CurrentWeatherRequester currentWeather() {
return new CurrentWeatherRequesterImpl(apiKey);
}
@SubscriptionAvailability(plans = ALL)
public FiveDayThreeHourStepForecastRequester forecast5Day3HourStep() {
return new FiveDayThreeHourStepForecastRequesterImpl(apiKey);
}
// TODO:
// * Forecast: hourly, daily
// * Air Pollution
// * Ultraviolet index
// DOCS
}