Class ImageSearchResponseBuilder
- All Implemented Interfaces:
Builder<ImageSearchResponse>
Example to create an instance using the builder pattern
ImageSearchResponse imageSearchResponse = ImageSearchResponse.builder()
.count(0.3)
.offset(0.3)
.total(0.3)
.plusResults(resultsBuilder -> resultsBuilder)
.build()
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionaddResults
(Function<ResultItemBuilder, ResultItem> builder) An array of image URLs of images that are similar to the query image.build()
builds ImageSearchResponse with checking for non-null required valuesbuilds ImageSearchResponse without checking for non-null required valuesThe maximum number of results to return from a query.getCount()
The maximum number of results to return from a query.Number of elements skipped.An array of image URLs of images that are similar to the query image.getTotal()
The total number of product images that were have been analyzed.static ImageSearchResponseBuilder
of()
factory method for an instance of ImageSearchResponseBuilderstatic ImageSearchResponseBuilder
of
(ImageSearchResponse template) create builder for ImageSearchResponse instanceNumber of elements skipped.plusResults
(ResultItem... results) An array of image URLs of images that are similar to the query image.An array of image URLs of images that are similar to the query image.results
(ResultItem... results) An array of image URLs of images that are similar to the query image.results
(List<ResultItem> results) An array of image URLs of images that are similar to the query image.setResults
(Function<ResultItemBuilder, ResultItem> builder) An array of image URLs of images that are similar to the query image.The total number of product images that were have been analyzed.An array of image URLs of images that are similar to the query image.
-
Constructor Details
-
ImageSearchResponseBuilder
public ImageSearchResponseBuilder()
-
-
Method Details
-
count
The maximum number of results to return from a query.
- Parameters:
count
- value to be set- Returns:
- Builder
-
offset
Number of elements skipped.
- Parameters:
offset
- value to be set- Returns:
- Builder
-
total
The total number of product images that were have been analyzed.
- Parameters:
total
- value to be set- Returns:
- Builder
-
results
An array of image URLs of images that are similar to the query image. If no matching images are found, results is empty.
- Parameters:
results
- value to be set- Returns:
- Builder
-
results
An array of image URLs of images that are similar to the query image. If no matching images are found, results is empty.
- Parameters:
results
- value to be set- Returns:
- Builder
-
plusResults
An array of image URLs of images that are similar to the query image. If no matching images are found, results is empty.
- Parameters:
results
- value to be set- Returns:
- Builder
-
plusResults
public ImageSearchResponseBuilder plusResults(Function<ResultItemBuilder, ResultItemBuilder> builder) An array of image URLs of images that are similar to the query image. If no matching images are found, results is empty.
- Parameters:
builder
- function to build the results value- Returns:
- Builder
-
withResults
public ImageSearchResponseBuilder withResults(Function<ResultItemBuilder, ResultItemBuilder> builder) An array of image URLs of images that are similar to the query image. If no matching images are found, results is empty.
- Parameters:
builder
- function to build the results value- Returns:
- Builder
-
addResults
An array of image URLs of images that are similar to the query image. If no matching images are found, results is empty.
- Parameters:
builder
- function to build the results value- Returns:
- Builder
-
setResults
An array of image URLs of images that are similar to the query image. If no matching images are found, results is empty.
- Parameters:
builder
- function to build the results value- Returns:
- Builder
-
getCount
The maximum number of results to return from a query.
- Returns:
- count
-
getOffset
Number of elements skipped.
- Returns:
- offset
-
getTotal
The total number of product images that were have been analyzed.
- Returns:
- total
-
getResults
An array of image URLs of images that are similar to the query image. If no matching images are found, results is empty.
- Returns:
- results
-
build
builds ImageSearchResponse with checking for non-null required values- Specified by:
build
in interfaceBuilder<ImageSearchResponse>
- Returns:
- ImageSearchResponse
-
buildUnchecked
builds ImageSearchResponse without checking for non-null required values- Returns:
- ImageSearchResponse
-
of
factory method for an instance of ImageSearchResponseBuilder- Returns:
- builder
-
of
create builder for ImageSearchResponse instance- Parameters:
template
- instance with prefilled values for the builder- Returns:
- builder
-