Interface ResultItem


public interface ResultItem

An image URL and the product variants it is contained in. If no matching images are found, ResultItem is not present.


Example to create an instance using the builder pattern

     ResultItem resultItem = ResultItem.builder()
             .imageUrl("{imageUrl}")
             .plusProductVariants(productVariantsBuilder -> productVariantsBuilder)
             .build()
 
  • Method Details

    • getImageUrl

      @NotNull @NotNull String getImageUrl()

      The URL of the image.

      Returns:
      imageUrl
    • getProductVariants

      @NotNull @Valid @NotNull @Valid List<ProductVariant> getProductVariants()

      An array of product variants containing the image URL.

      Returns:
      productVariants
    • setImageUrl

      void setImageUrl(String imageUrl)

      The URL of the image.

      Parameters:
      imageUrl - value to be set
    • setProductVariants

      void setProductVariants(ProductVariant... productVariants)

      An array of product variants containing the image URL.

      Parameters:
      productVariants - values to be set
    • setProductVariants

      void setProductVariants(List<ProductVariant> productVariants)

      An array of product variants containing the image URL.

      Parameters:
      productVariants - values to be set
    • of

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

      static ResultItem of(ResultItem template)
      factory method to create a shallow copy ResultItem
      Parameters:
      template - instance to be copied
      Returns:
      copy instance
    • deepCopy

      @Nullable static ResultItem deepCopy(@Nullable ResultItem template)
      factory method to create a deep copy of ResultItem
      Parameters:
      template - instance to be copied
      Returns:
      copy instance
    • builder

      static ResultItemBuilder builder()
      builder factory method for ResultItem
      Returns:
      builder
    • builder

      static ResultItemBuilder builder(ResultItem template)
      create builder for ResultItem instance
      Parameters:
      template - instance with prefilled values for the builder
      Returns:
      builder
    • withResultItem

      default <T> T withResultItem(Function<ResultItem,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<ResultItem> typeReference()
      gives a TypeReference for usage with Jackson DataBind
      Returns:
      TypeReference