Class ShoppingItemMapper

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

public class ShoppingItemMapper extends Object
The ShoppingItemMapper class contains methods for mapping between FridgeItems and ShoppingItems model, and between Item and ShoppingListLoadDTO DTO.
  • Constructor Details

    • ShoppingItemMapper

      public ShoppingItemMapper()
  • Method Details

    • toShoppingItem

      public static ShoppingItems toShoppingItem(FridgeItems fridgeItems)
      This method converts a FridgeItems object to a ShoppingItems object.
      Parameters:
      fridgeItems - FridgeItems object to be converted.
      Returns:
      ShoppingItems object.
    • toShoppingListLoadDTO

      public static ShoppingListLoadDTO toShoppingListLoadDTO(Item item, int quantity, boolean suggestion)
      This method converts an Item object to a ShoppingListLoadDTO object.
      Parameters:
      item - Item object to be converted.
      quantity - The quantity of the item.
      suggestion - Boolean value representing whether the item is a suggestion or not.
      Returns:
      ShoppingListLoadDTO object.