Package de.bcxp.challenge.weather
Class WeatherEntry
java.lang.Object
de.bcxp.challenge.common.model.DocumentEntry
de.bcxp.challenge.weather.WeatherEntry
- All Implemented Interfaces:
IEntryWithComparableNumericTuple
Represents a weather data entry for a specific day, containing the maximum and minimum temperatures.
This class extends DocumentEntry
and provides additional temperature-specific information.
- See Also:
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionWeatherEntry
(String day, double maxTemp, double minTemp) Constructs aWeatherEntry
object for a specific day with the given maximum and minimum temperatures. -
Method Summary
Methods inherited from class de.bcxp.challenge.common.model.DocumentEntry
getId
-
Field Details
-
logger
private static final org.apache.logging.log4j.Logger logger -
maxTemp
private final double maxTemp -
minTemp
private final double minTemp
-
-
Constructor Details
-
WeatherEntry
Constructs aWeatherEntry
object for a specific day with the given maximum and minimum temperatures.- Parameters:
day
- the name or identifier of the daymaxTemp
- the maximum temperature for the dayminTemp
- the minimum temperature for the day- Throws:
IllegalArgumentException
- ifmaxTemp
is less thanminTemp
-
-
Method Details
-
getBestMatchScore
public double getBestMatchScore()Retrieves the numeric difference between this day's maximum and minimum temperature.- Specified by:
getBestMatchScore
in interfaceIEntryWithComparableNumericTuple
- Returns:
- Temperature spread in double format.
-
getDay
-
getMaxTemp
public double getMaxTemp() -
getMinTemp
public double getMinTemp() -
toString
-