Class ProductSearchResultBuilder

java.lang.Object
com.commercetools.api.models.product_search.ProductSearchResultBuilder
All Implemented Interfaces:
Builder<ProductSearchResult>

public class ProductSearchResultBuilder extends Object implements Builder<ProductSearchResult>
ProductSearchResultBuilder
Example to create an instance using the builder pattern

     ProductSearchResult productSearchResult = ProductSearchResult.builder()
             .id("{id}")
             .build()
 
  • Constructor Details

    • ProductSearchResultBuilder

      public ProductSearchResultBuilder()
  • Method Details

    • id

      id of the Product that matches the search query.

      Parameters:
      id - value to be set
      Returns:
      Builder
    • matchingVariants

      Information about which Product Variants match the search query. Only present if markMatchingVariants is set to true in the ProductSearchRequest.

      Parameters:
      builder - function to build the matchingVariants value
      Returns:
      Builder
    • withMatchingVariants

      Information about which Product Variants match the search query. Only present if markMatchingVariants is set to true in the ProductSearchRequest.

      Parameters:
      builder - function to build the matchingVariants value
      Returns:
      Builder
    • matchingVariants

      public ProductSearchResultBuilder matchingVariants(@Nullable ProductSearchMatchingVariants matchingVariants)

      Information about which Product Variants match the search query. Only present if markMatchingVariants is set to true in the ProductSearchRequest.

      Parameters:
      matchingVariants - value to be set
      Returns:
      Builder
    • productProjection

      Projected data of the Product with id. Only present if data integration with Product Projection parameters is requested.

      Parameters:
      builder - function to build the productProjection value
      Returns:
      Builder
    • withProductProjection

      Projected data of the Product with id. Only present if data integration with Product Projection parameters is requested.

      Parameters:
      builder - function to build the productProjection value
      Returns:
      Builder
    • productProjection

      public ProductSearchResultBuilder productProjection(@Nullable ProductProjection productProjection)

      Projected data of the Product with id. Only present if data integration with Product Projection parameters is requested.

      Parameters:
      productProjection - value to be set
      Returns:
      Builder
    • getId

      public String getId()

      id of the Product that matches the search query.

      Returns:
      id
    • getMatchingVariants

      @Nullable public ProductSearchMatchingVariants getMatchingVariants()

      Information about which Product Variants match the search query. Only present if markMatchingVariants is set to true in the ProductSearchRequest.

      Returns:
      matchingVariants
    • getProductProjection

      @Nullable public ProductProjection getProductProjection()

      Projected data of the Product with id. Only present if data integration with Product Projection parameters is requested.

      Returns:
      productProjection
    • build

      public ProductSearchResult build()
      builds ProductSearchResult with checking for non-null required values
      Specified by:
      build in interface Builder<ProductSearchResult>
      Returns:
      ProductSearchResult
    • buildUnchecked

      public ProductSearchResult buildUnchecked()
      builds ProductSearchResult without checking for non-null required values
      Returns:
      ProductSearchResult
    • of

      public static ProductSearchResultBuilder of()
      factory method for an instance of ProductSearchResultBuilder
      Returns:
      builder
    • of

      public static ProductSearchResultBuilder of(ProductSearchResult template)
      create builder for ProductSearchResult instance
      Parameters:
      template - instance with prefilled values for the builder
      Returns:
      builder