Class ProductSearchResultBuilder
java.lang.Object
com.commercetools.api.models.product_search.ProductSearchResultBuilder
- All Implemented Interfaces:
Builder<ProductSearchResult>
ProductSearchResultBuilder
Example to create an instance using the builder pattern
Example to create an instance using the builder pattern
ProductSearchResult productSearchResult = ProductSearchResult.builder()
.id("{id}")
.build()
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
builds ProductSearchResult with checking for non-null required valuesbuilds ProductSearchResult without checking for non-null required valuesgetId()
Unique identifier of the Product.Describes the variants that matched the search criteria.Contains Product Projection data for Products matching theprojection
field in the Search Products request.Unique identifier of the Product.matchingVariants
(ProductSearchMatchingVariants matchingVariants) Describes the variants that matched the search criteria.matchingVariants
(Function<ProductSearchMatchingVariantsBuilder, ProductSearchMatchingVariantsBuilder> builder) Describes the variants that matched the search criteria.static ProductSearchResultBuilder
of()
factory method for an instance of ProductSearchResultBuilderstatic ProductSearchResultBuilder
of
(ProductSearchResult template) create builder for ProductSearchResult instanceproductProjection
(ProductProjection productProjection) Contains Product Projection data for Products matching theprojection
field in the Search Products request.Contains Product Projection data for Products matching theprojection
field in the Search Products request.withMatchingVariants
(Function<ProductSearchMatchingVariantsBuilder, ProductSearchMatchingVariants> builder) Describes the variants that matched the search criteria.Contains Product Projection data for Products matching theprojection
field in the Search Products request.
-
Constructor Details
-
ProductSearchResultBuilder
public ProductSearchResultBuilder()
-
-
Method Details
-
id
Unique identifier of the Product.
- Parameters:
id
- value to be set- Returns:
- Builder
-
productProjection
public ProductSearchResultBuilder productProjection(Function<ProductProjectionBuilder, ProductProjectionBuilder> builder) Contains Product Projection data for Products matching the
projection
field in the Search Products request.- Parameters:
builder
- function to build the productProjection value- Returns:
- Builder
-
withProductProjection
public ProductSearchResultBuilder withProductProjection(Function<ProductProjectionBuilder, ProductProjection> builder) Contains Product Projection data for Products matching the
projection
field in the Search Products request.- Parameters:
builder
- function to build the productProjection value- Returns:
- Builder
-
productProjection
Contains Product Projection data for Products matching the
projection
field in the Search Products request.- Parameters:
productProjection
- value to be set- Returns:
- Builder
-
matchingVariants
public ProductSearchResultBuilder matchingVariants(Function<ProductSearchMatchingVariantsBuilder, ProductSearchMatchingVariantsBuilder> builder) Describes the variants that matched the search criteria.
- Parameters:
builder
- function to build the matchingVariants value- Returns:
- Builder
-
withMatchingVariants
public ProductSearchResultBuilder withMatchingVariants(Function<ProductSearchMatchingVariantsBuilder, ProductSearchMatchingVariants> builder) Describes the variants that matched the search criteria.
- Parameters:
builder
- function to build the matchingVariants value- Returns:
- Builder
-
matchingVariants
public ProductSearchResultBuilder matchingVariants(@Nullable ProductSearchMatchingVariants matchingVariants) Describes the variants that matched the search criteria.
- Parameters:
matchingVariants
- value to be set- Returns:
- Builder
-
getId
Unique identifier of the Product.
- Returns:
- id
-
getProductProjection
Contains Product Projection data for Products matching the
projection
field in the Search Products request.- Returns:
- productProjection
-
getMatchingVariants
Describes the variants that matched the search criteria.
- Returns:
- matchingVariants
-
build
builds ProductSearchResult with checking for non-null required values- Specified by:
build
in interfaceBuilder<ProductSearchResult>
- Returns:
- ProductSearchResult
-
buildUnchecked
builds ProductSearchResult without checking for non-null required values- Returns:
- ProductSearchResult
-
of
factory method for an instance of ProductSearchResultBuilder- Returns:
- builder
-
of
create builder for ProductSearchResult instance- Parameters:
template
- instance with prefilled values for the builder- Returns:
- builder
-