Class ProductConverter

java.lang.Object
com.glowmart.shop_management.converter.ProductConverter

public class ProductConverter extends Object
Utility class for converting between Product and ProductDto.
  • Constructor Details

    • ProductConverter

      public ProductConverter()
  • Method Details

    • convertToProduct

      public static Product convertToProduct(ProductDto productDto)
      Converts a ProductDto object to a Product entity.
      Parameters:
      productDto - The DTO to be converted.
      Returns:
      The corresponding Product entity.
    • convertToProductDto

      public static ProductDto convertToProductDto(Product product)
      Converts a Product entity to a ProductDto.
      Parameters:
      product - The entity to be converted.
      Returns:
      The corresponding ProductDto.