Interface ProductImport

All Superinterfaces:
ImportResource

public interface ProductImport extends ImportResource

Represents the data used to import a Product. Once imported, this data is persisted as a Product in the Project.

This is the minimal representation required for creating a Product in Composable Commerce.


Example to create an instance using the builder pattern

     ProductImport productImport = ProductImport.builder()
             .key("{key}")
             .name(nameBuilder -> nameBuilder)
             .productType(productTypeBuilder -> productTypeBuilder)
             .slug(slugBuilder -> slugBuilder)
             .build()
 
  • Method Details

    • getKey

      @NotNull @NotNull String getKey()

      User-defined unique identifier. If a Product with this key exists, it is updated with the imported data.

      Specified by:
      getKey in interface ImportResource
      Returns:
      key
    • getName

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

      Maps to ProductData.name.

      Returns:
      name
    • getProductType

      @NotNull @Valid @NotNull @Valid ProductTypeKeyReference getProductType()

      Maps to Product.productType. If the referenced ProductType does not exist, the state of the ImportOperation will be set to unresolved until the referenced ProductType is created.

      Returns:
      productType
    • getSlug

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

      Maps to ProductData.slug.

      Returns:
      slug
    • getDescription

      @Valid @Valid LocalizedString getDescription()

      Maps to ProductData.description.

      Returns:
      description
    • getCategories

      @Valid @Valid List<CategoryKeyReference> getCategories()

      Maps to ProductData.categories. If the referenced Categories do not exist, the state of the ImportOperation will be set to unresolved until the referenced Categories are created.

      Returns:
      categories
    • getAttributes

      @Valid @Valid List<Attribute> getAttributes()
      Returns:
      attributes
    • getMetaTitle

      @Valid @Valid LocalizedString getMetaTitle()

      Maps to ProductData.metaTitle.

      Returns:
      metaTitle
    • getMetaDescription

      @Valid @Valid LocalizedString getMetaDescription()

      Maps to ProductData.metaDescription.

      Returns:
      metaDescription
    • getMetaKeywords

      @Valid @Valid LocalizedString getMetaKeywords()

      Maps to ProductData.metaKeywords.

      Returns:
      metaKeywords
    • getTaxCategory

      @Valid @Valid TaxCategoryKeyReference getTaxCategory()

      Maps to Product.taxCategory. If the referenced TaxCategory does not exist, the state of the ImportOperation will be set to unresolved until the referenced TaxCategory is created.

      Returns:
      taxCategory
    • getSearchKeywords

      @Valid @Valid SearchKeywords getSearchKeywords()

      Maps to ProductData.searchKeywords.

      Returns:
      searchKeywords
    • getState

      @Valid @Valid StateKeyReference getState()

      Maps to Product.state. If the referenced State does not exist, the state of the ImportOperation will be set to unresolved until the referenced State is created.

      Returns:
      state
    • getPublish

      Boolean getPublish()

      Determines the published status and current/staged projection of the Product. For more information, see Managing the published state of Products.

      Returns:
      publish
    • getPriceMode

      ProductPriceModeEnum getPriceMode()

      Maps to Product.priceMode.

      Returns:
      priceMode
    • setKey

      void setKey(String key)

      User-defined unique identifier. If a Product with this key exists, it is updated with the imported data.

      Specified by:
      setKey in interface ImportResource
      Parameters:
      key - value to be set
    • setName

      void setName(LocalizedString name)

      Maps to ProductData.name.

      Parameters:
      name - value to be set
    • setProductType

      void setProductType(ProductTypeKeyReference productType)

      Maps to Product.productType. If the referenced ProductType does not exist, the state of the ImportOperation will be set to unresolved until the referenced ProductType is created.

      Parameters:
      productType - value to be set
    • setSlug

      void setSlug(LocalizedString slug)

      Maps to ProductData.slug.

      Parameters:
      slug - value to be set
    • setDescription

      void setDescription(LocalizedString description)

      Maps to ProductData.description.

      Parameters:
      description - value to be set
    • setCategories

      void setCategories(CategoryKeyReference... categories)

      Maps to ProductData.categories. If the referenced Categories do not exist, the state of the ImportOperation will be set to unresolved until the referenced Categories are created.

      Parameters:
      categories - values to be set
    • setCategories

      void setCategories(List<CategoryKeyReference> categories)

      Maps to ProductData.categories. If the referenced Categories do not exist, the state of the ImportOperation will be set to unresolved until the referenced Categories are created.

      Parameters:
      categories - values to be set
    • setAttributes

      void setAttributes(Attribute... attributes)
      set attributes
      Parameters:
      attributes - values to be set
    • setAttributes

      void setAttributes(List<Attribute> attributes)
      set attributes
      Parameters:
      attributes - values to be set
    • setMetaTitle

      void setMetaTitle(LocalizedString metaTitle)

      Maps to ProductData.metaTitle.

      Parameters:
      metaTitle - value to be set
    • setMetaDescription

      void setMetaDescription(LocalizedString metaDescription)

      Maps to ProductData.metaDescription.

      Parameters:
      metaDescription - value to be set
    • setMetaKeywords

      void setMetaKeywords(LocalizedString metaKeywords)

      Maps to ProductData.metaKeywords.

      Parameters:
      metaKeywords - value to be set
    • setTaxCategory

      void setTaxCategory(TaxCategoryKeyReference taxCategory)

      Maps to Product.taxCategory. If the referenced TaxCategory does not exist, the state of the ImportOperation will be set to unresolved until the referenced TaxCategory is created.

      Parameters:
      taxCategory - value to be set
    • setSearchKeywords

      void setSearchKeywords(SearchKeywords searchKeywords)

      Maps to ProductData.searchKeywords.

      Parameters:
      searchKeywords - value to be set
    • setState

      void setState(StateKeyReference state)

      Maps to Product.state. If the referenced State does not exist, the state of the ImportOperation will be set to unresolved until the referenced State is created.

      Parameters:
      state - value to be set
    • setPublish

      void setPublish(Boolean publish)

      Determines the published status and current/staged projection of the Product. For more information, see Managing the published state of Products.

      Parameters:
      publish - value to be set
    • setPriceMode

      void setPriceMode(ProductPriceModeEnum priceMode)

      Maps to Product.priceMode.

      Parameters:
      priceMode - value to be set
    • of

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

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

      ProductImport copyDeep()
      Specified by:
      copyDeep in interface ImportResource
    • deepCopy

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

      static ProductImportBuilder builder()
      builder factory method for ProductImport
      Returns:
      builder
    • builder

      static ProductImportBuilder builder(ProductImport template)
      create builder for ProductImport instance
      Parameters:
      template - instance with prefilled values for the builder
      Returns:
      builder
    • withProductImport

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