Interface ImageSearchResponse


public interface ImageSearchResponse

Response format from image search endpoint.


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()
 
  • Method Details

    • getCount

      @NotNull @NotNull Integer getCount()

      The maximum number of results to return from a query.

      Returns:
      count
    • getOffset

      @NotNull @NotNull Double getOffset()

      Number of elements skipped.

      Returns:
      offset
    • getTotal

      @NotNull @NotNull Integer getTotal()

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

      Returns:
      total
    • getResults

      @NotNull @Valid @NotNull @Valid 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
    • setCount

      void setCount(Integer count)

      The maximum number of results to return from a query.

      Parameters:
      count - value to be set
    • setOffset

      void setOffset(Double offset)

      Number of elements skipped.

      Parameters:
      offset - value to be set
    • setTotal

      void setTotal(Integer total)

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

      Parameters:
      total - value to be set
    • setResults

      void setResults(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 - values to be set
    • setResults

      void setResults(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 - values to be set
    • of

      static ImageSearchResponse of()
      factory method
      Returns:
      instance of ImageSearchResponse
    • of

      factory method to create a shallow copy ImageSearchResponse
      Parameters:
      template - instance to be copied
      Returns:
      copy instance
    • deepCopy

      factory method to create a deep copy of ImageSearchResponse
      Parameters:
      template - instance to be copied
      Returns:
      copy instance
    • builder

      static ImageSearchResponseBuilder builder()
      builder factory method for ImageSearchResponse
      Returns:
      builder
    • builder

      create builder for ImageSearchResponse instance
      Parameters:
      template - instance with prefilled values for the builder
      Returns:
      builder
    • withImageSearchResponse

      default <T> T withImageSearchResponse(Function<ImageSearchResponse,T> helper)
      accessor map function
      Type Parameters:
      T - mapped type
      Parameters:
      helper - function to map the object
      Returns:
      mapped value
    • typeReference

      static com.fasterxml.jackson.core.type.TypeReference<ImageSearchResponse> typeReference()
      gives a TypeReference for usage with Jackson DataBind
      Returns:
      TypeReference