Package com.jahnreil_stratpoint.service
Interface IProductService
public interface IProductService
The interface Product service.
-
Method Summary
Modifier and TypeMethodDescriptioncalculateTotalPrice
(Product product) Calculates the total price for the given product.createProduct
(Product product) Creates a new product.void
deleteProduct
(int productId) Deletes a product by its ID.findProduct
(ArrayList<Product> products, int id) Finds a product by its ID in the given list of products.void
retrieveProducts
(ArrayList<Product> products) Retrieves a list of products.void
searchProduct
(ArrayList<Product> products) Searches for products based on certain criteria.updateProduct
(Product product) Updates an existing product.void
viewProduct
(ArrayList<Product> products) Views details of products.
-
Method Details
-
calculateTotalPrice
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
Creates a new product.- Parameters:
product
- The product object containing details of the new product to create.- Returns:
- The created product object.
-
retrieveProducts
Retrieves a list of products.- Parameters:
products
- The list of products to retrieve.
-
updateProduct
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
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
Searches for products based on certain criteria.- Parameters:
products
- The list of products to search within.
-
viewProduct
Views details of products.- Parameters:
products
- The list of products to view details of.
-