Interface ProductDraft

All Superinterfaces:
Draft<ProductDraft>, WithKey

public interface ProductDraft extends WithKey, Draft<ProductDraft>
ProductDraft
Example to create an instance using the builder pattern

     ProductDraft productDraft = ProductDraft.builder()
             .productType(productTypeBuilder -> productTypeBuilder)
             .name(nameBuilder -> nameBuilder)
             .slug(slugBuilder -> slugBuilder)
             .build()
 
  • Method Details

    • getProductType

      @NotNull @Valid @NotNull @Valid ProductTypeResourceIdentifier getProductType()

      The Product Type defining the Attributes for the Product. Cannot be changed later.

      Returns:
      productType
    • getName

      @NotNull @Valid @NotNull @Valid LocalizedString getName()

      Name of the Product.

      Returns:
      name
    • getSlug

      @NotNull @Valid @NotNull @Valid LocalizedString getSlug()

      User-defined identifier used in a deep-link URL for the Product. It must be unique across a Project, but a Product can have the same slug in different Locales. It must match the pattern [a-zA-Z0-9_\\-]{2,256}.

      Returns:
      slug
    • getKey

      String getKey()

      User-defined unique identifier for the Product.

      This field is optional for backwards compatibility reasons, but we strongly recommend setting it. Keys are mandatory for importing Products with the Import API and the Merchant Center.

      To update a Product using the Import API or Merchant Center, the Product key must match the pattern ^[A-Za-z0-9_-]{2,256}$.

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

      @Valid @Valid LocalizedString getDescription()

      Description of the Product.

      Returns:
      description
    • getCategories

      @Valid @Valid List<CategoryResourceIdentifier> getCategories()

      Categories assigned to the Product.

      Returns:
      categories
    • getCategoryOrderHints

      @Valid @Valid CategoryOrderHints getCategoryOrderHints()

      Numerical values to allow ordering of Products within a specified Category.

      Returns:
      categoryOrderHints
    • getMetaTitle

      @Valid @Valid LocalizedString getMetaTitle()

      Title of the Product as used by search engines.

      Returns:
      metaTitle
    • getMetaDescription

      @Valid @Valid LocalizedString getMetaDescription()

      Description of the Product as used by search engines.

      Returns:
      metaDescription
    • getMetaKeywords

      @Valid @Valid LocalizedString getMetaKeywords()

      Keywords that give additional information about the Product to search engines.

      Returns:
      metaKeywords
    • getMasterVariant

      @Valid @Valid ProductVariantDraft getMasterVariant()

      The Product Variant to be the Master Variant for the Product. Required if variants are provided also.

      Returns:
      masterVariant
    • getVariants

      @Valid @Valid List<ProductVariantDraft> getVariants()

      The additional Product Variants for the Product.

      Returns:
      variants
    • getTaxCategory

      @Valid @Valid TaxCategoryResourceIdentifier getTaxCategory()

      The Tax Category to be assigned to the Product.

      Returns:
      taxCategory
    • getSearchKeywords

      @Valid @Valid SearchKeywords getSearchKeywords()

      Used by Product Suggestions, but is also considered for a full text search.

      Returns:
      searchKeywords
    • getState

      @Valid @Valid StateResourceIdentifier getState()

      State to be assigned to the Product.

      Returns:
      state
    • getPublish

      Boolean getPublish()

      If true, the Product is published immediately to the current projection.

      Returns:
      publish
    • getPriceMode

      ProductPriceModeEnum getPriceMode()

      Specifies the type of prices used when looking up a price for the Product.

      Returns:
      priceMode
    • setProductType

      void setProductType(ProductTypeResourceIdentifier productType)

      The Product Type defining the Attributes for the Product. Cannot be changed later.

      Parameters:
      productType - value to be set
    • setName

      void setName(LocalizedString name)

      Name of the Product.

      Parameters:
      name - value to be set
    • setSlug

      void setSlug(LocalizedString slug)

      User-defined identifier used in a deep-link URL for the Product. It must be unique across a Project, but a Product can have the same slug in different Locales. It must match the pattern [a-zA-Z0-9_\\-]{2,256}.

      Parameters:
      slug - value to be set
    • setKey

      void setKey(String key)

      User-defined unique identifier for the Product.

      This field is optional for backwards compatibility reasons, but we strongly recommend setting it. Keys are mandatory for importing Products with the Import API and the Merchant Center.

      To update a Product using the Import API or Merchant Center, the Product key must match the pattern ^[A-Za-z0-9_-]{2,256}$.

      Parameters:
      key - value to be set
    • setDescription

      void setDescription(LocalizedString description)

      Description of the Product.

      Parameters:
      description - value to be set
    • setCategories

      void setCategories(CategoryResourceIdentifier... categories)

      Categories assigned to the Product.

      Parameters:
      categories - values to be set
    • setCategories

      void setCategories(List<CategoryResourceIdentifier> categories)

      Categories assigned to the Product.

      Parameters:
      categories - values to be set
    • setCategoryOrderHints

      void setCategoryOrderHints(CategoryOrderHints categoryOrderHints)

      Numerical values to allow ordering of Products within a specified Category.

      Parameters:
      categoryOrderHints - value to be set
    • setMetaTitle

      void setMetaTitle(LocalizedString metaTitle)

      Title of the Product as used by search engines.

      Parameters:
      metaTitle - value to be set
    • setMetaDescription

      void setMetaDescription(LocalizedString metaDescription)

      Description of the Product as used by search engines.

      Parameters:
      metaDescription - value to be set
    • setMetaKeywords

      void setMetaKeywords(LocalizedString metaKeywords)

      Keywords that give additional information about the Product to search engines.

      Parameters:
      metaKeywords - value to be set
    • setMasterVariant

      void setMasterVariant(ProductVariantDraft masterVariant)

      The Product Variant to be the Master Variant for the Product. Required if variants are provided also.

      Parameters:
      masterVariant - value to be set
    • setVariants

      void setVariants(ProductVariantDraft... variants)

      The additional Product Variants for the Product.

      Parameters:
      variants - values to be set
    • setVariants

      void setVariants(List<ProductVariantDraft> variants)

      The additional Product Variants for the Product.

      Parameters:
      variants - values to be set
    • setTaxCategory

      void setTaxCategory(TaxCategoryResourceIdentifier taxCategory)

      The Tax Category to be assigned to the Product.

      Parameters:
      taxCategory - value to be set
    • setSearchKeywords

      void setSearchKeywords(SearchKeywords searchKeywords)

      Used by Product Suggestions, but is also considered for a full text search.

      Parameters:
      searchKeywords - value to be set
    • setState

      void setState(StateResourceIdentifier state)

      State to be assigned to the Product.

      Parameters:
      state - value to be set
    • setPublish

      void setPublish(Boolean publish)

      If true, the Product is published immediately to the current projection.

      Parameters:
      publish - value to be set
    • setPriceMode

      void setPriceMode(ProductPriceModeEnum priceMode)

      Specifies the type of prices used when looking up a price for the Product.

      Parameters:
      priceMode - value to be set
    • of

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

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

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

      static ProductDraftBuilder builder()
      builder factory method for ProductDraft
      Returns:
      builder
    • builder

      static ProductDraftBuilder builder(ProductDraft template)
      create builder for ProductDraft instance
      Parameters:
      template - instance with prefilled values for the builder
      Returns:
      builder
    • withProductDraft

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