Package fr.utc.miage.sporttrack.dto
Class MeteoDTO
java.lang.Object
fr.utc.miage.sporttrack.dto.MeteoDTO
Data Transfer Object (DTO) representing weather (meteorological) data
retrieved from an external weather API within the SportTrack application.
This DTO carries the weather information for a given location, including a validity flag and an informational message indicating whether the data was successfully fetched.
- Author:
- SportTrack Team
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetCity()Returns the city name for the weather data.Returns the country for the weather data.Returns the informational message about the weather data retrieval.Returns the total precipitation sum.Returns the WMO weather code.booleanisValid()Returns whether the weather data is valid.voidSets the city name for the weather data.voidsetCountry(String country) Sets the country for the weather data.voidsetMessage(String message) Sets the informational message about the weather data retrieval.voidsetPrecipitationSum(Double precipitationSum) Sets the total precipitation sum.voidsetValid(boolean valid) Sets whether the weather data is valid.voidsetWeatherCode(Integer weatherCode) Sets the WMO weather code.
-
Constructor Details
-
MeteoDTO
public MeteoDTO()
-
-
Method Details
-
getCity
Returns the city name for the weather data.- Returns:
- the city name
-
setCity
Sets the city name for the weather data.- Parameters:
city- the city name to assign
-
getCountry
Returns the country for the weather data.- Returns:
- the country code or name
-
setCountry
Sets the country for the weather data.- Parameters:
country- the country code or name to assign
-
getWeatherCode
Returns the WMO weather code.- Returns:
- the weather code, or
nullif unavailable
-
setWeatherCode
Sets the WMO weather code.- Parameters:
weatherCode- the weather code to assign
-
getPrecipitationSum
Returns the total precipitation sum.- Returns:
- the precipitation in millimetres
-
setPrecipitationSum
Sets the total precipitation sum.- Parameters:
precipitationSum- the precipitation in millimetres to assign
-
isValid
public boolean isValid()Returns whether the weather data is valid.- Returns:
trueif the data was successfully retrieved,falseotherwise
-
setValid
public void setValid(boolean valid) Sets whether the weather data is valid.- Parameters:
valid-trueif valid,falseotherwise
-
getMessage
Returns the informational message about the weather data retrieval.- Returns:
- the result message
-
setMessage
Sets the informational message about the weather data retrieval.- Parameters:
message- the result message to assign
-