/* Weather Station Package: weather Descrizione: Weather Station – bollettino meteo da open-meteo.com Applicazione console che interroga il servizio open-meteo.com (https://api.open-meteo.com/) per un capoluogo di regione italiano, recupera un sottoinsieme di misure meteorologiche correnti e giornaliere in JSON e le presenta in un report testuale formattato. L'utente inserisce il nome di una città tra i capoluoghi supportati; il programma crea un'istanza di WeatherStation e stampa in console il bollettino meteo corrispondente. Autore: Alessio Severi Licenza: MIT License MIT License Copyright (c) 2025 Alessio Severi Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ package weather; import java.util.Scanner; /** * Punto di ingresso dell'applicazione Weather Station. *
* Gestisce l'interazione da console con l'utente, acquisisce il nome * del capoluogo italiano e delega la generazione del report meteo * alla classe {@link WeatherStation}. */ public class Main { /** * Avvia l'applicazione da linea di comando. * * @param args argomenti passati da riga di comando (non utilizzati). */ public static void main(String[] args) { try (Scanner sc = new Scanner(System.in)) { System.out.print(""" \n\n Benvenuto in Weather Station. I dati meteo sono forniti dal servizio open-meteo.com. Inserisci il nome di un capoluogo di regione italiano per visualizzare le condizioni meteo della città: \000"""); // Crea una WeatherStation associata alla città inserita // dall'utente e stampa il report meteo formattato. System.out.println(new WeatherStation(sc.nextLine()).buildReport()); } } }