Interface ProductVariantDraft

All Superinterfaces:
Draft<ProductVariantDraft>, WithKey

public interface ProductVariantDraft extends WithKey, Draft<ProductVariantDraft>

Creates a Product Variant when included in the masterVariant and variants fields of the ProductDraft.


Example to create an instance using the builder pattern

     ProductVariantDraft productVariantDraft = ProductVariantDraft.builder()
             .build()
 
  • Method Details

    • getSku

      String getSku()

      User-defined unique SKU of the Product Variant.

      Returns:
      sku
    • getKey

      String getKey()

      User-defined unique identifier for the ProductVariant.

      Specified by:
      getKey in interface WithKey
      Returns:
      key
    • getPrices

      @Valid @Valid List<PriceDraft> getPrices()

      The Embedded Prices for the Product Variant. Each Price must have its unique Price scope (with same currency, country, Customer Group, Channel, validFrom and validUntil).

      Returns:
      prices
    • getAttributes

      @Valid @Valid List<Attribute> getAttributes()

      Attributes according to the respective AttributeDefinition.

      Returns:
      attributes
    • getImages

      @Valid @Valid List<Image> getImages()

      Images for the Product Variant.

      Returns:
      images
    • getAssets

      @Valid @Valid List<AssetDraft> getAssets()

      Media assets for the Product Variant.

      Returns:
      assets
    • setSku

      void setSku(String sku)

      User-defined unique SKU of the Product Variant.

      Parameters:
      sku - value to be set
    • setKey

      void setKey(String key)

      User-defined unique identifier for the ProductVariant.

      Parameters:
      key - value to be set
    • setPrices

      void setPrices(PriceDraft... prices)

      The Embedded Prices for the Product Variant. Each Price must have its unique Price scope (with same currency, country, Customer Group, Channel, validFrom and validUntil).

      Parameters:
      prices - values to be set
    • setPrices

      void setPrices(List<PriceDraft> prices)

      The Embedded Prices for the Product Variant. Each Price must have its unique Price scope (with same currency, country, Customer Group, Channel, validFrom and validUntil).

      Parameters:
      prices - values to be set
    • setAttributes

      void setAttributes(Attribute... attributes)

      Attributes according to the respective AttributeDefinition.

      Parameters:
      attributes - values to be set
    • setAttributes

      void setAttributes(List<Attribute> attributes)

      Attributes according to the respective AttributeDefinition.

      Parameters:
      attributes - values to be set
    • setImages

      void setImages(Image... images)

      Images for the Product Variant.

      Parameters:
      images - values to be set
    • setImages

      void setImages(List<Image> images)

      Images for the Product Variant.

      Parameters:
      images - values to be set
    • setAssets

      void setAssets(AssetDraft... assets)

      Media assets for the Product Variant.

      Parameters:
      assets - values to be set
    • setAssets

      void setAssets(List<AssetDraft> assets)

      Media assets for the Product Variant.

      Parameters:
      assets - values to be set
    • of

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

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

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

      static ProductVariantDraftBuilder builder()
      builder factory method for ProductVariantDraft
      Returns:
      builder
    • builder

      create builder for ProductVariantDraft instance
      Parameters:
      template - instance with prefilled values for the builder
      Returns:
      builder
    • withProductVariantDraft

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