Class ProductImportImpl

java.lang.Object
com.commercetools.importapi.models.products.ProductImportImpl
All Implemented Interfaces:
ImportResource, ProductImport, io.vrap.rmf.base.client.ModelBase

public class ProductImportImpl extends Object implements ProductImport, io.vrap.rmf.base.client.ModelBase

The data representation for a Product to be imported that is persisted as a Product in the Project.

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

  • Constructor Details

    • ProductImportImpl

      public ProductImportImpl()
      create empty instance
  • Method Details

    • getKey

      public String getKey()

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

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

      public LocalizedString getName()

      Maps to Product.name.

      Specified by:
      getName in interface ProductImport
      Returns:
      name
    • getProductType

      public ProductTypeKeyReference getProductType()

      The productType of a Product. Maps to Product.productType. The Reference to the ProductType with which the Product is associated. If referenced ProductType does not exist, the state of the ImportOperation will be set to unresolved until the necessary ProductType is created.

      Specified by:
      getProductType in interface ProductImport
      Returns:
      productType
    • getSlug

      public LocalizedString getSlug()

      Human-readable identifiers usually used as deep-link URL to the related product. Each slug must be unique across a Project, but a product can have the same slug for different languages. Allowed are alphabetic, numeric, underscore (_) and hyphen (-) characters.

      Specified by:
      getSlug in interface ProductImport
      Returns:
      slug
    • getDescription

      public LocalizedString getDescription()

      Maps to Product.description.

      Specified by:
      getDescription in interface ProductImport
      Returns:
      description
    • getCategories

      public List<CategoryKeyReference> getCategories()

      Maps to Product.categories. The References to the Categories with which the Product is associated. If referenced Categories do not exist, the state of the ImportOperation will be set to unresolved until the necessary Categories are created.

      Specified by:
      getCategories in interface ProductImport
      Returns:
      categories
    • getMetaTitle

      public LocalizedString getMetaTitle()

      A localized string is a JSON object where the keys are of IETF language tag, and the values the corresponding strings used for that language.

      {
          "de": "Hundefutter",
          "en": "dog food"
        }
        
      Specified by:
      getMetaTitle in interface ProductImport
      Returns:
      metaTitle
    • getMetaDescription

      public LocalizedString getMetaDescription()

      A localized string is a JSON object where the keys are of IETF language tag, and the values the corresponding strings used for that language.

      {
          "de": "Hundefutter",
          "en": "dog food"
        }
        
      Specified by:
      getMetaDescription in interface ProductImport
      Returns:
      metaDescription
    • getMetaKeywords

      public LocalizedString getMetaKeywords()

      A localized string is a JSON object where the keys are of IETF language tag, and the values the corresponding strings used for that language.

      {
          "de": "Hundefutter",
          "en": "dog food"
        }
        
      Specified by:
      getMetaKeywords in interface ProductImport
      Returns:
      metaKeywords
    • getTaxCategory

      public TaxCategoryKeyReference getTaxCategory()

      The Reference to the TaxCategory with which the Product is associated. If referenced TaxCategory does not exist, the state of the ImportOperation will be set to unresolved until the necessary TaxCategory is created.

      Specified by:
      getTaxCategory in interface ProductImport
      Returns:
      taxCategory
    • getSearchKeywords

      public SearchKeywords getSearchKeywords()

      Search keywords are primarily used by the suggester but are also considered for the full-text search. SearchKeywords is a JSON object where the keys are of IETF language tag. The value to a language tag key is an array of SearchKeyword for the specific language.

      {
          "en": [
            { "text": "Multi tool" },
            { "text": "Swiss Army Knife", "suggestTokenizer": { "type": "whitespace" } }
          ],
          "de": [
            {
              "text": "Schweizer Messer",
              "suggestTokenizer": {
                "type": "custom",
                "inputs": ["schweizer messer", "offiziersmesser", "sackmesser"]
              }
            }
          ]
        }
        
      Specified by:
      getSearchKeywords in interface ProductImport
      Returns:
      searchKeywords
    • getState

      public StateKeyReference getState()

      The Reference to the State with which the Product is associated. If referenced State does not exist, the state of the ImportOperation will be set to unresolved until the necessary State is created.

      Specified by:
      getState in interface ProductImport
      Returns:
      state
    • getPublish

      public Boolean getPublish()

      If publish is set to either true or false, both staged and current projections are set to the same value provided by the import data. If publish is not set, the staged projection is set to the provided import data, but the current projection stays unchanged. However, if the import data contains no update, that is, if it matches the staged projection of the existing Product, the import induces no change in the existing Product whether publish is set or not.

      Specified by:
      getPublish in interface ProductImport
      Returns:
      publish
    • getPriceMode

      public ProductPriceModeEnum getPriceMode()

      Determines the type of Prices the API uses. See ProductPriceMode for more details. If not provided, the existing Product.priceMode is not changed.

      Specified by:
      getPriceMode in interface ProductImport
      Returns:
      priceMode
    • setKey

      public void setKey(String key)
      Description copied from interface: ProductImport

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

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

      public void setName(LocalizedString name)
      Description copied from interface: ProductImport

      Maps to Product.name.

      Specified by:
      setName in interface ProductImport
      Parameters:
      name - value to be set
    • setProductType

      public void setProductType(ProductTypeKeyReference productType)
      Description copied from interface: ProductImport

      The productType of a Product. Maps to Product.productType. The Reference to the ProductType with which the Product is associated. If referenced ProductType does not exist, the state of the ImportOperation will be set to unresolved until the necessary ProductType is created.

      Specified by:
      setProductType in interface ProductImport
      Parameters:
      productType - value to be set
    • setSlug

      public void setSlug(LocalizedString slug)
      Description copied from interface: ProductImport

      Human-readable identifiers usually used as deep-link URL to the related product. Each slug must be unique across a Project, but a product can have the same slug for different languages. Allowed are alphabetic, numeric, underscore (_) and hyphen (-) characters.

      Specified by:
      setSlug in interface ProductImport
      Parameters:
      slug - value to be set
    • setDescription

      public void setDescription(LocalizedString description)
      Description copied from interface: ProductImport

      Maps to Product.description.

      Specified by:
      setDescription in interface ProductImport
      Parameters:
      description - value to be set
    • setCategories

      public void setCategories(CategoryKeyReference... categories)
      Description copied from interface: ProductImport

      Maps to Product.categories. The References to the Categories with which the Product is associated. If referenced Categories do not exist, the state of the ImportOperation will be set to unresolved until the necessary Categories are created.

      Specified by:
      setCategories in interface ProductImport
      Parameters:
      categories - values to be set
    • setCategories

      public void setCategories(List<CategoryKeyReference> categories)
      Description copied from interface: ProductImport

      Maps to Product.categories. The References to the Categories with which the Product is associated. If referenced Categories do not exist, the state of the ImportOperation will be set to unresolved until the necessary Categories are created.

      Specified by:
      setCategories in interface ProductImport
      Parameters:
      categories - values to be set
    • setMetaTitle

      public void setMetaTitle(LocalizedString metaTitle)
      Description copied from interface: ProductImport

      A localized string is a JSON object where the keys are of IETF language tag, and the values the corresponding strings used for that language.

      {
          "de": "Hundefutter",
          "en": "dog food"
        }
        
      Specified by:
      setMetaTitle in interface ProductImport
      Parameters:
      metaTitle - value to be set
    • setMetaDescription

      public void setMetaDescription(LocalizedString metaDescription)
      Description copied from interface: ProductImport

      A localized string is a JSON object where the keys are of IETF language tag, and the values the corresponding strings used for that language.

      {
          "de": "Hundefutter",
          "en": "dog food"
        }
        
      Specified by:
      setMetaDescription in interface ProductImport
      Parameters:
      metaDescription - value to be set
    • setMetaKeywords

      public void setMetaKeywords(LocalizedString metaKeywords)
      Description copied from interface: ProductImport

      A localized string is a JSON object where the keys are of IETF language tag, and the values the corresponding strings used for that language.

      {
          "de": "Hundefutter",
          "en": "dog food"
        }
        
      Specified by:
      setMetaKeywords in interface ProductImport
      Parameters:
      metaKeywords - value to be set
    • setTaxCategory

      public void setTaxCategory(TaxCategoryKeyReference taxCategory)
      Description copied from interface: ProductImport

      The Reference to the TaxCategory with which the Product is associated. If referenced TaxCategory does not exist, the state of the ImportOperation will be set to unresolved until the necessary TaxCategory is created.

      Specified by:
      setTaxCategory in interface ProductImport
      Parameters:
      taxCategory - value to be set
    • setSearchKeywords

      public void setSearchKeywords(SearchKeywords searchKeywords)
      Description copied from interface: ProductImport

      Search keywords are primarily used by the suggester but are also considered for the full-text search. SearchKeywords is a JSON object where the keys are of IETF language tag. The value to a language tag key is an array of SearchKeyword for the specific language.

      {
          "en": [
            { "text": "Multi tool" },
            { "text": "Swiss Army Knife", "suggestTokenizer": { "type": "whitespace" } }
          ],
          "de": [
            {
              "text": "Schweizer Messer",
              "suggestTokenizer": {
                "type": "custom",
                "inputs": ["schweizer messer", "offiziersmesser", "sackmesser"]
              }
            }
          ]
        }
        
      Specified by:
      setSearchKeywords in interface ProductImport
      Parameters:
      searchKeywords - value to be set
    • setState

      public void setState(StateKeyReference state)
      Description copied from interface: ProductImport

      The Reference to the State with which the Product is associated. If referenced State does not exist, the state of the ImportOperation will be set to unresolved until the necessary State is created.

      Specified by:
      setState in interface ProductImport
      Parameters:
      state - value to be set
    • setPublish

      public void setPublish(Boolean publish)
      Description copied from interface: ProductImport

      If publish is set to either true or false, both staged and current projections are set to the same value provided by the import data. If publish is not set, the staged projection is set to the provided import data, but the current projection stays unchanged. However, if the import data contains no update, that is, if it matches the staged projection of the existing Product, the import induces no change in the existing Product whether publish is set or not.

      Specified by:
      setPublish in interface ProductImport
      Parameters:
      publish - value to be set
    • setPriceMode

      public void setPriceMode(ProductPriceModeEnum priceMode)
      Description copied from interface: ProductImport

      Determines the type of Prices the API uses. See ProductPriceMode for more details. If not provided, the existing Product.priceMode is not changed.

      Specified by:
      setPriceMode in interface ProductImport
      Parameters:
      priceMode - value to be set
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object