Class ImageSearchResponseBuilder

java.lang.Object
com.commercetools.ml.models.image_search.ImageSearchResponseBuilder
All Implemented Interfaces:
Builder<ImageSearchResponse>

public class ImageSearchResponseBuilder extends Object implements Builder<ImageSearchResponse>
ImageSearchResponseBuilder
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 Details

    • ImageSearchResponseBuilder

      public ImageSearchResponseBuilder()
  • Method Details

    • count

      public ImageSearchResponseBuilder count(Integer count)

      The maximum number of results to return from a query.

      Parameters:
      count - value to be set
      Returns:
      Builder
    • offset

      public ImageSearchResponseBuilder offset(Double offset)

      Number of elements skipped.

      Parameters:
      offset - value to be set
      Returns:
      Builder
    • total

      public ImageSearchResponseBuilder total(Integer total)

      The total number of product images that were have been analyzed.

      Parameters:
      total - value to be set
      Returns:
      Builder
    • results

      public ImageSearchResponseBuilder results(ResultItem... 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

      public ImageSearchResponseBuilder results(List<ResultItem> 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

      public ImageSearchResponseBuilder plusResults(ResultItem... 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:
      builder - function to build the results value
      Returns:
      Builder
    • withResults

      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

      public Integer getCount()

      The maximum number of results to return from a query.

      Returns:
      count
    • getOffset

      public Double getOffset()

      Number of elements skipped.

      Returns:
      offset
    • getTotal

      public Integer getTotal()

      The total number of product images that were have been analyzed.

      Returns:
      total
    • getResults

      public List<ResultItem> 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

      public ImageSearchResponse build()
      builds ImageSearchResponse with checking for non-null required values
      Specified by:
      build in interface Builder<ImageSearchResponse>
      Returns:
      ImageSearchResponse
    • buildUnchecked

      public ImageSearchResponse buildUnchecked()
      builds ImageSearchResponse without checking for non-null required values
      Returns:
      ImageSearchResponse
    • of

      public static ImageSearchResponseBuilder of()
      factory method for an instance of ImageSearchResponseBuilder
      Returns:
      builder
    • of

      public static ImageSearchResponseBuilder of(ImageSearchResponse template)
      create builder for ImageSearchResponse instance
      Parameters:
      template - instance with prefilled values for the builder
      Returns:
      builder