Class WeatherData

java.lang.Object
gr.unipi.weather_app.model.WeatherData

@Entity public class WeatherData extends Object
Represents weather data for a specific city, including temperature, humidity, wind speed, UV index, weather description, and a timestamp. This class is mapped to the "weather_data" table in the "public" schema using JPA annotations. Lombok is used to reduce boilerplate code for getters, setters, and constructors.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private String
    The name of the city for which the weather data is recorded.
    private int
    The humidity percentage.
    private int
    The unique identifier for the weather data record.
    private int
    The temperature in degrees Celsius.
    The timestamp when the weather data was recorded.
    private int
    The UV index, representing the intensity of ultraviolet radiation.
    private String
    A brief textual description of the weather conditions.
    private int
    The wind speed in kilometers per hour.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns a formatted string representation of the weather data.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Field Details

    • id

      private int id
      The unique identifier for the weather data record. It is auto-generated and cannot be modified after creation.
    • city

      private String city
      The name of the city for which the weather data is recorded. It cannot be null and has a maximum length of 50 characters.
    • temperature

      private int temperature
      The temperature in degrees Celsius. It cannot be null.
    • humidity

      private int humidity
      The humidity percentage. It cannot be null.
    • windSpeed

      private int windSpeed
      The wind speed in kilometers per hour. It cannot be null.
    • uvIndex

      private int uvIndex
      The UV index, representing the intensity of ultraviolet radiation. It cannot be null.
    • weather_description

      private String weather_description
      A brief textual description of the weather conditions. It cannot be null.
    • timestamp

      private LocalDateTime timestamp
      The timestamp when the weather data was recorded. It cannot be null.
  • Constructor Details

    • WeatherData

      public WeatherData()
  • Method Details

    • toString

      public String toString()
      Returns a formatted string representation of the weather data.
      Overrides:
      toString in class Object
      Returns:
      A human-readable weather report including temperature, humidity, wind speed, UV index, weather description, and timestamp.