Class StatMapper

java.lang.Object
edu.ntnu.idatt2106_2023_06.backend.mapper.StatMapper

public class StatMapper extends Object
The StatMapper class contains methods for mapping between Stat DTOs and Statistics models.
  • Constructor Details

    • StatMapper

      public StatMapper()
  • Method Details

    • toStatistics

      public static List<Statistics> toStatistics(StatDeleteFromFridgeDTO statDeleteFromFridgeDTO, User user, Fridge fridge, StatType statType1)
      Converts StatDeleteFromFridgeDTO to a list of Statistics models.
      Parameters:
      statDeleteFromFridgeDTO - DTO containing information about deleted items
      user - User who deleted the items
      fridge - Fridge from which the items were deleted
      statType1 - Type of statistic to generate
      Returns:
      List of Statistics models generated from DTO information
    • toStatistics

      public static Statistics toStatistics(StatAddItemToFridgeDTO statAddItemToFridgeDTO, User user, Fridge fridge, StatType statType)
      Converts StatAddItemToFridgeDTO to a Statistics model.
      Parameters:
      statAddItemToFridgeDTO - DTO containing information about added items
      user - User who added the items
      fridge - Fridge to which the items were added
      statType - Type of statistic to generate
      Returns:
      Statistics model generated from DTO information