Package dev.ucomprotocol.spi
Interface CatalogAdapter
public interface CatalogAdapter
Adapter interface for product catalog operations.
Implement this interface to connect to a commerce platform's product catalog.
-
Method Summary
Modifier and TypeMethodDescriptiongetProductById(String id) Retrieves a product by its ID.getProductsByCategory(String categoryId) Retrieves products belonging to a specific category.searchProducts(String query) Searches for products matching a query string.
-
Method Details
-
getProductById
Retrieves a product by its ID.- Parameters:
id- the unique identifier of the product- Returns:
- an
Optionalcontaining the product if found, or empty otherwise
-
searchProducts
Searches for products matching a query string.- Parameters:
query- the search query- Returns:
- a list of matching products, or an empty list if none found
-
getProductsByCategory
Retrieves products belonging to a specific category.- Parameters:
categoryId- the unique identifier of the category- Returns:
- a list of products in the category, or an empty list if none found
-