Class ItemMapper

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

public class ItemMapper extends Object
This class is a mapper that maps between the Item model and the Item DTOs.
Author:
Leon Egeberg Hesthaug, Trym Hamer Gudvangen
  • Constructor Details

    • ItemMapper

      public ItemMapper()
  • Method Details

    • toItem

      public static Item toItem(ItemDTO itemDTO, Store store)
      This method maps an ItemDTO and a Store to an Item.
      Parameters:
      itemDTO - The item DTO to map
      store - The store to map
      Returns:
      The mapped item
    • toItemDTO

      public static ItemDTO toItemDTO(Item item, int quantity, Boolean suggestion)
      This method maps an Item and a quantity to an ItemDTO.
      Parameters:
      item - The item to map
      quantity - The quantity to map
      Returns:
      The mapped item DTO