Class ResultItemBuilder
java.lang.Object
com.commercetools.ml.models.image_search.ResultItemBuilder
- All Implemented Interfaces:
Builder<ResultItem>
ResultItemBuilder
Example to create an instance using the builder pattern
Example to create an instance using the builder pattern
ResultItem resultItem = ResultItem.builder()
.imageUrl("{imageUrl}")
.plusProductVariants(productVariantsBuilder -> productVariantsBuilder)
.build()
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionAn array of product variants containing the image URL.build()
builds ResultItem with checking for non-null required valuesbuilds ResultItem without checking for non-null required valuesThe URL of the image.An array of product variants containing the image URL.The URL of the image.static ResultItemBuilder
of()
factory method for an instance of ResultItemBuilderstatic ResultItemBuilder
of
(ResultItem template) create builder for ResultItem instanceplusProductVariants
(ProductVariant... productVariants) An array of product variants containing the image URL.An array of product variants containing the image URL.productVariants
(ProductVariant... productVariants) An array of product variants containing the image URL.productVariants
(List<ProductVariant> productVariants) An array of product variants containing the image URL.An array of product variants containing the image URL.An array of product variants containing the image URL.
-
Constructor Details
-
ResultItemBuilder
public ResultItemBuilder()
-
-
Method Details
-
imageUrl
The URL of the image.
- Parameters:
imageUrl
- value to be set- Returns:
- Builder
-
productVariants
An array of product variants containing the image URL.
- Parameters:
productVariants
- value to be set- Returns:
- Builder
-
productVariants
An array of product variants containing the image URL.
- Parameters:
productVariants
- value to be set- Returns:
- Builder
-
plusProductVariants
An array of product variants containing the image URL.
- Parameters:
productVariants
- value to be set- Returns:
- Builder
-
plusProductVariants
public ResultItemBuilder plusProductVariants(Function<ProductVariantBuilder, ProductVariantBuilder> builder) An array of product variants containing the image URL.
- Parameters:
builder
- function to build the productVariants value- Returns:
- Builder
-
withProductVariants
public ResultItemBuilder withProductVariants(Function<ProductVariantBuilder, ProductVariantBuilder> builder) An array of product variants containing the image URL.
- Parameters:
builder
- function to build the productVariants value- Returns:
- Builder
-
addProductVariants
An array of product variants containing the image URL.
- Parameters:
builder
- function to build the productVariants value- Returns:
- Builder
-
setProductVariants
An array of product variants containing the image URL.
- Parameters:
builder
- function to build the productVariants value- Returns:
- Builder
-
getImageUrl
The URL of the image.
- Returns:
- imageUrl
-
getProductVariants
An array of product variants containing the image URL.
- Returns:
- productVariants
-
build
builds ResultItem with checking for non-null required values- Specified by:
build
in interfaceBuilder<ResultItem>
- Returns:
- ResultItem
-
buildUnchecked
builds ResultItem without checking for non-null required values- Returns:
- ResultItem
-
of
factory method for an instance of ResultItemBuilder- Returns:
- builder
-
of
create builder for ResultItem instance- Parameters:
template
- instance with prefilled values for the builder- Returns:
- builder
-