Class SimilarProductsPagedQueryResultBuilder
java.lang.Object
com.commercetools.ml.models.similar_products.SimilarProductsPagedQueryResultBuilder
- All Implemented Interfaces:
Builder<SimilarProductsPagedQueryResult>
public class SimilarProductsPagedQueryResultBuilder
extends Object
implements Builder<SimilarProductsPagedQueryResult>
SimilarProductsPagedQueryResultBuilder
Example to create an instance using the builder pattern
Example to create an instance using the builder pattern
SimilarProductsPagedQueryResult similarProductsPagedQueryResult = SimilarProductsPagedQueryResult.builder()
.count(0.3)
.total(0.3)
.offset(0.3)
.plusResults(resultsBuilder -> resultsBuilder)
.meta(metaBuilder -> metaBuilder)
.build()
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionadd the value to the results using the builder functionbuild()
builds SimilarProductsPagedQueryResult with checking for non-null required valuesbuilds SimilarProductsPagedQueryResult without checking for non-null required valuesset the value to the countgetCount()
value of count}getMeta()
value of meta}Number of elements skipped.value of results}getTotal()
value of total}set the value to the metameta
(Function<SimilarProductSearchRequestMetaBuilder, SimilarProductSearchRequestMetaBuilder> builder) set the value to the meta using the builder functionof()
factory method for an instance of SimilarProductsPagedQueryResultBuilderof
(SimilarProductsPagedQueryResult template) create builder for SimilarProductsPagedQueryResult instanceNumber of elements skipped.plusResults
(SimilarProductPair... results) add values to the resultsadd the value to the results using the builder functionresults
(SimilarProductPair... results) set values to the resultsresults
(List<SimilarProductPair> results) set value to the resultsset the value to the results using the builder functionset the value to the totalset the value to the meta using the builder functionset the value to the results using the builder function
-
Constructor Details
-
SimilarProductsPagedQueryResultBuilder
public SimilarProductsPagedQueryResultBuilder()
-
-
Method Details
-
count
set the value to the count- Parameters:
count
- value to be set- Returns:
- Builder
-
total
set the value to the total- Parameters:
total
- value to be set- Returns:
- Builder
-
offset
Number of elements skipped.
- Parameters:
offset
- value to be set- Returns:
- Builder
-
results
set values to the results- Parameters:
results
- value to be set- Returns:
- Builder
-
results
set value to the results- Parameters:
results
- value to be set- Returns:
- Builder
-
plusResults
add values to the results- Parameters:
results
- value to be set- Returns:
- Builder
-
plusResults
public SimilarProductsPagedQueryResultBuilder plusResults(Function<SimilarProductPairBuilder, SimilarProductPairBuilder> builder) add the value to the results using the builder function- Parameters:
builder
- function to build the results value- Returns:
- Builder
-
withResults
public SimilarProductsPagedQueryResultBuilder withResults(Function<SimilarProductPairBuilder, SimilarProductPairBuilder> builder) set the value to the results using the builder function- Parameters:
builder
- function to build the results value- Returns:
- Builder
-
addResults
public SimilarProductsPagedQueryResultBuilder addResults(Function<SimilarProductPairBuilder, SimilarProductPair> builder) add the value to the results using the builder function- Parameters:
builder
- function to build the results value- Returns:
- Builder
-
setResults
public SimilarProductsPagedQueryResultBuilder setResults(Function<SimilarProductPairBuilder, SimilarProductPair> builder) set the value to the results using the builder function- Parameters:
builder
- function to build the results value- Returns:
- Builder
-
meta
public SimilarProductsPagedQueryResultBuilder meta(Function<SimilarProductSearchRequestMetaBuilder, SimilarProductSearchRequestMetaBuilder> builder) set the value to the meta using the builder function- Parameters:
builder
- function to build the meta value- Returns:
- Builder
-
withMeta
public SimilarProductsPagedQueryResultBuilder withMeta(Function<SimilarProductSearchRequestMetaBuilder, SimilarProductSearchRequestMeta> builder) set the value to the meta using the builder function- Parameters:
builder
- function to build the meta value- Returns:
- Builder
-
meta
set the value to the meta- Parameters:
meta
- value to be set- Returns:
- Builder
-
getCount
value of count}- Returns:
- count
-
getTotal
value of total}- Returns:
- total
-
getOffset
Number of elements skipped.
- Returns:
- offset
-
getResults
value of results}- Returns:
- results
-
getMeta
value of meta}- Returns:
- meta
-
build
builds SimilarProductsPagedQueryResult with checking for non-null required values- Specified by:
build
in interfaceBuilder<SimilarProductsPagedQueryResult>
- Returns:
- SimilarProductsPagedQueryResult
-
buildUnchecked
builds SimilarProductsPagedQueryResult without checking for non-null required values- Returns:
- SimilarProductsPagedQueryResult
-
of
factory method for an instance of SimilarProductsPagedQueryResultBuilder- Returns:
- builder
-
of
create builder for SimilarProductsPagedQueryResult instance- Parameters:
template
- instance with prefilled values for the builder- Returns:
- builder
-