mirror of
https://github.com/Prominence/openweathermap-java-api.git
synced 2026-07-03 03:06:45 +03:00
Initial implementation of free-plan forecast retriever. Small refactoring.
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user