Class StatMapper
java.lang.Object
edu.ntnu.idatt2106_2023_06.backend.mapper.StatMapper
The StatMapper class contains methods for mapping between Stat DTOs and Statistics models.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Statistics
toStatistics
(StatAddItemToFridgeDTO statAddItemToFridgeDTO, User user, Fridge fridge, StatType statType) Converts StatAddItemToFridgeDTO to a Statistics model.static List<Statistics>
toStatistics
(StatDeleteFromFridgeDTO statDeleteFromFridgeDTO, User user, Fridge fridge, StatType statType1) Converts StatDeleteFromFridgeDTO to a list of 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 itemsuser
- User who deleted the itemsfridge
- Fridge from which the items were deletedstatType1
- 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 itemsuser
- User who added the itemsfridge
- Fridge to which the items were addedstatType
- Type of statistic to generate- Returns:
- Statistics model generated from DTO information
-