Class WeatherEntry

java.lang.Object
de.bcxp.challenge.common.model.DocumentEntry
de.bcxp.challenge.weather.WeatherEntry
All Implemented Interfaces:
IEntryWithComparableNumericTuple

public class WeatherEntry extends DocumentEntry implements 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 Details

    • logger

      private static final org.apache.logging.log4j.Logger logger
    • maxTemp

      private final double maxTemp
    • minTemp

      private final double minTemp
  • Constructor Details

    • WeatherEntry

      public WeatherEntry(String day, double maxTemp, double minTemp)
      Constructs a WeatherEntry object for a specific day with the given maximum and minimum temperatures.
      Parameters:
      day - the name or identifier of the day
      maxTemp - the maximum temperature for the day
      minTemp - the minimum temperature for the day
      Throws:
      IllegalArgumentException - if maxTemp is less than minTemp
  • Method Details

    • getBestMatchScore

      public double getBestMatchScore()
      Retrieves the numeric difference between this day's maximum and minimum temperature.
      Specified by:
      getBestMatchScore in interface IEntryWithComparableNumericTuple
      Returns:
      Temperature spread in double format.
    • getDay

      public String getDay()
    • getMaxTemp

      public double getMaxTemp()
    • getMinTemp

      public double getMinTemp()
    • toString

      public String toString()
      Overrides:
      toString in class Object