Interface CatalogAdapter


public interface CatalogAdapter
Adapter interface for product catalog operations.

Implement this interface to connect to a commerce platform's product catalog.

  • Method Details

    • getProductById

      Optional<Product> getProductById(String id)
      Retrieves a product by its ID.
      Parameters:
      id - the unique identifier of the product
      Returns:
      an Optional containing the product if found, or empty otherwise
    • searchProducts

      List<Product> searchProducts(String query)
      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

      List<Product> getProductsByCategory(String categoryId)
      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