Interface ProductVariant


public interface ProductVariant

The product variant that contains the image.


Example to create an instance using the builder pattern

     ProductVariant productVariant = ProductVariant.builder()
             .product(productBuilder -> productBuilder)
             .staged(true)
             .variantId(0.3)
             .build()
 
  • Method Details

    • getProduct

      @NotNull @Valid @NotNull @Valid ProductReference getProduct()

      The product that contains this variant.

      Returns:
      product
    • getStaged

      @NotNull @NotNull Boolean getStaged()

      The state of the product variant.

      Returns:
      staged
    • getVariantId

      @NotNull @NotNull Integer getVariantId()

      The id of the product variant.

      Returns:
      variantId
    • setProduct

      void setProduct(ProductReference product)

      The product that contains this variant.

      Parameters:
      product - value to be set
    • setStaged

      void setStaged(Boolean staged)

      The state of the product variant.

      Parameters:
      staged - value to be set
    • setVariantId

      void setVariantId(Integer variantId)

      The id of the product variant.

      Parameters:
      variantId - value to be set
    • of

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

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

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

      static ProductVariantBuilder builder()
      builder factory method for ProductVariant
      Returns:
      builder
    • builder

      static ProductVariantBuilder builder(ProductVariant template)
      create builder for ProductVariant instance
      Parameters:
      template - instance with prefilled values for the builder
      Returns:
      builder
    • withProductVariant

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