Class SimilarProductPairBuilder
java.lang.Object
com.commercetools.ml.models.similar_products.SimilarProductPairBuilder
- All Implemented Interfaces:
Builder<SimilarProductPair>
SimilarProductPairBuilder
Example to create an instance using the builder pattern
Example to create an instance using the builder pattern
SimilarProductPair similarProductPair = SimilarProductPair.builder()
.confidence(0.3)
.plusProducts(productsBuilder -> productsBuilder)
.build()
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionadd the value to the products using the builder functionbuild()
builds SimilarProductPair with checking for non-null required valuesbuilds SimilarProductPair without checking for non-null required valuesconfidence
(Double confidence) The probability of product similarity.The probability of product similarity.value of products}static SimilarProductPairBuilder
of()
factory method for an instance of SimilarProductPairBuilderstatic SimilarProductPairBuilder
of
(SimilarProductPair template) create builder for SimilarProductPair instanceplusProducts
(SimilarProduct... products) add values to the productsadd the value to the products using the builder functionproducts
(SimilarProduct... products) set values to the productsproducts
(List<SimilarProduct> products) set value to the productsset the value to the products using the builder functionset the value to the products using the builder function
-
Constructor Details
-
SimilarProductPairBuilder
public SimilarProductPairBuilder()
-
-
Method Details
-
confidence
The probability of product similarity.
- Parameters:
confidence
- value to be set- Returns:
- Builder
-
products
set values to the products- Parameters:
products
- value to be set- Returns:
- Builder
-
products
set value to the products- Parameters:
products
- value to be set- Returns:
- Builder
-
plusProducts
add values to the products- Parameters:
products
- value to be set- Returns:
- Builder
-
plusProducts
public SimilarProductPairBuilder plusProducts(Function<SimilarProductBuilder, SimilarProductBuilder> builder) add the value to the products using the builder function- Parameters:
builder
- function to build the products value- Returns:
- Builder
-
withProducts
public SimilarProductPairBuilder withProducts(Function<SimilarProductBuilder, SimilarProductBuilder> builder) set the value to the products using the builder function- Parameters:
builder
- function to build the products value- Returns:
- Builder
-
addProducts
public SimilarProductPairBuilder addProducts(Function<SimilarProductBuilder, SimilarProduct> builder) add the value to the products using the builder function- Parameters:
builder
- function to build the products value- Returns:
- Builder
-
setProducts
public SimilarProductPairBuilder setProducts(Function<SimilarProductBuilder, SimilarProduct> builder) set the value to the products using the builder function- Parameters:
builder
- function to build the products value- Returns:
- Builder
-
getConfidence
The probability of product similarity.
- Returns:
- confidence
-
getProducts
value of products}- Returns:
- products
-
build
builds SimilarProductPair with checking for non-null required values- Specified by:
build
in interfaceBuilder<SimilarProductPair>
- Returns:
- SimilarProductPair
-
buildUnchecked
builds SimilarProductPair without checking for non-null required values- Returns:
- SimilarProductPair
-
of
factory method for an instance of SimilarProductPairBuilder- Returns:
- builder
-
of
create builder for SimilarProductPair instance- Parameters:
template
- instance with prefilled values for the builder- Returns:
- builder
-