Interface IProductService


public interface IProductService
The interface Product service.
  • Method Details

    • calculateTotalPrice

      BigDecimal calculateTotalPrice(Product product)
      Calculates the total price for the given product.
      Parameters:
      product - The product for which to calculate the total price.
      Returns:
      The total price of the product as a BigDecimal.
    • createProduct

      Product createProduct(Product product)
      Creates a new product.
      Parameters:
      product - The product object containing details of the new product to create.
      Returns:
      The created product object.
    • retrieveProducts

      void retrieveProducts(ArrayList<Product> products)
      Retrieves a list of products.
      Parameters:
      products - The list of products to retrieve.
    • updateProduct

      Product updateProduct(Product product)
      Updates an existing product.
      Parameters:
      product - The product object containing updated details.
      Returns:
      The updated product object.
    • deleteProduct

      void deleteProduct(int productId)
      Deletes a product by its ID.
      Parameters:
      productId - The ID of the product to delete.
    • findProduct

      Optional<Product> findProduct(ArrayList<Product> products, int id)
      Finds a product by its ID in the given list of products.
      Parameters:
      products - The list of products to search in.
      id - The ID of the product to find.
      Returns:
      An Optional containing the product if found, otherwise an empty Optional.
    • searchProduct

      void searchProduct(ArrayList<Product> products)
      Searches for products based on certain criteria.
      Parameters:
      products - The list of products to search within.
    • viewProduct

      void viewProduct(ArrayList<Product> products)
      Views details of products.
      Parameters:
      products - The list of products to view details of.