Class ProductImportBuilder

java.lang.Object
com.commercetools.importapi.models.products.ProductImportBuilder
All Implemented Interfaces:
Builder<ProductImport>

public class ProductImportBuilder extends Object implements Builder<ProductImport>
ProductImportBuilder
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()
 
  • Constructor Details

    • ProductImportBuilder

      public ProductImportBuilder()
  • Method Details

    • key

      public ProductImportBuilder key(String key)

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

      Parameters:
      key - value to be set
      Returns:
      Builder
    • name

      Maps to Product.name.

      Parameters:
      builder - function to build the name value
      Returns:
      Builder
    • withName

      Maps to Product.name.

      Parameters:
      builder - function to build the name value
      Returns:
      Builder
    • name

      Maps to Product.name.

      Parameters:
      name - value to be set
      Returns:
      Builder
    • productType

      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.

      Parameters:
      builder - function to build the productType value
      Returns:
      Builder
    • withProductType

      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.

      Parameters:
      builder - function to build the productType value
      Returns:
      Builder
    • productType

      public ProductImportBuilder productType(ProductTypeKeyReference productType)

      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.

      Parameters:
      productType - value to be set
      Returns:
      Builder
    • slug

      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.

      Parameters:
      builder - function to build the slug value
      Returns:
      Builder
    • withSlug

      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.

      Parameters:
      builder - function to build the slug value
      Returns:
      Builder
    • slug

      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.

      Parameters:
      slug - value to be set
      Returns:
      Builder
    • description

      Maps to Product.description.

      Parameters:
      builder - function to build the description value
      Returns:
      Builder
    • withDescription

      Maps to Product.description.

      Parameters:
      builder - function to build the description value
      Returns:
      Builder
    • description

      public ProductImportBuilder description(@Nullable LocalizedString description)

      Maps to Product.description.

      Parameters:
      description - value to be set
      Returns:
      Builder
    • categories

      public ProductImportBuilder categories(@Nullable CategoryKeyReference... categories)

      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.

      Parameters:
      categories - value to be set
      Returns:
      Builder
    • categories

      public ProductImportBuilder categories(@Nullable List<CategoryKeyReference> categories)

      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.

      Parameters:
      categories - value to be set
      Returns:
      Builder
    • plusCategories

      public ProductImportBuilder plusCategories(@Nullable CategoryKeyReference... categories)

      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.

      Parameters:
      categories - value to be set
      Returns:
      Builder
    • plusCategories

      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.

      Parameters:
      builder - function to build the categories value
      Returns:
      Builder
    • withCategories

      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.

      Parameters:
      builder - function to build the categories value
      Returns:
      Builder
    • addCategories

      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.

      Parameters:
      builder - function to build the categories value
      Returns:
      Builder
    • setCategories

      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.

      Parameters:
      builder - function to build the categories value
      Returns:
      Builder
    • metaTitle

      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"
        }
        
      Parameters:
      builder - function to build the metaTitle value
      Returns:
      Builder
    • withMetaTitle

      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"
        }
        
      Parameters:
      builder - function to build the metaTitle value
      Returns:
      Builder
    • metaTitle

      public ProductImportBuilder metaTitle(@Nullable LocalizedString metaTitle)

      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"
        }
        
      Parameters:
      metaTitle - value to be set
      Returns:
      Builder
    • metaDescription

      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"
        }
        
      Parameters:
      builder - function to build the metaDescription value
      Returns:
      Builder
    • withMetaDescription

      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"
        }
        
      Parameters:
      builder - function to build the metaDescription value
      Returns:
      Builder
    • metaDescription

      public ProductImportBuilder metaDescription(@Nullable LocalizedString metaDescription)

      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"
        }
        
      Parameters:
      metaDescription - value to be set
      Returns:
      Builder
    • metaKeywords

      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"
        }
        
      Parameters:
      builder - function to build the metaKeywords value
      Returns:
      Builder
    • withMetaKeywords

      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"
        }
        
      Parameters:
      builder - function to build the metaKeywords value
      Returns:
      Builder
    • metaKeywords

      public ProductImportBuilder metaKeywords(@Nullable LocalizedString metaKeywords)

      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"
        }
        
      Parameters:
      metaKeywords - value to be set
      Returns:
      Builder
    • taxCategory

      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.

      Parameters:
      builder - function to build the taxCategory value
      Returns:
      Builder
    • withTaxCategory

      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.

      Parameters:
      builder - function to build the taxCategory value
      Returns:
      Builder
    • taxCategory

      public ProductImportBuilder taxCategory(@Nullable TaxCategoryKeyReference taxCategory)

      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.

      Parameters:
      taxCategory - value to be set
      Returns:
      Builder
    • searchKeywords

      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"]
              }
            }
          ]
        }
        
      Parameters:
      builder - function to build the searchKeywords value
      Returns:
      Builder
    • withSearchKeywords

      public ProductImportBuilder withSearchKeywords(Function<SearchKeywordsBuilder,SearchKeywords> builder)

      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"]
              }
            }
          ]
        }
        
      Parameters:
      builder - function to build the searchKeywords value
      Returns:
      Builder
    • searchKeywords

      public ProductImportBuilder searchKeywords(@Nullable SearchKeywords searchKeywords)

      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"]
              }
            }
          ]
        }
        
      Parameters:
      searchKeywords - value to be set
      Returns:
      Builder
    • state

      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.

      Parameters:
      builder - function to build the state value
      Returns:
      Builder
    • withState

      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.

      Parameters:
      builder - function to build the state value
      Returns:
      Builder
    • state

      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.

      Parameters:
      state - value to be set
      Returns:
      Builder
    • publish

      public ProductImportBuilder publish(@Nullable Boolean publish)

      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.

      Parameters:
      publish - value to be set
      Returns:
      Builder
    • priceMode

      public ProductImportBuilder priceMode(@Nullable ProductPriceModeEnum priceMode)

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

      Parameters:
      priceMode - value to be set
      Returns:
      Builder
    • getKey

      public String getKey()

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

      Returns:
      key
    • getName

      public LocalizedString getName()

      Maps to Product.name.

      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.

      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.

      Returns:
      slug
    • getDescription

      @Nullable public LocalizedString getDescription()

      Maps to Product.description.

      Returns:
      description
    • getCategories

      @Nullable 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.

      Returns:
      categories
    • getMetaTitle

      @Nullable 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"
        }
        
      Returns:
      metaTitle
    • getMetaDescription

      @Nullable 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"
        }
        
      Returns:
      metaDescription
    • getMetaKeywords

      @Nullable 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"
        }
        
      Returns:
      metaKeywords
    • getTaxCategory

      @Nullable 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.

      Returns:
      taxCategory
    • getSearchKeywords

      @Nullable 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"]
              }
            }
          ]
        }
        
      Returns:
      searchKeywords
    • getState

      @Nullable 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.

      Returns:
      state
    • getPublish

      @Nullable 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.

      Returns:
      publish
    • getPriceMode

      @Nullable 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.

      Returns:
      priceMode
    • build

      public ProductImport build()
      builds ProductImport with checking for non-null required values
      Specified by:
      build in interface Builder<ProductImport>
      Returns:
      ProductImport
    • buildUnchecked

      public ProductImport buildUnchecked()
      builds ProductImport without checking for non-null required values
      Returns:
      ProductImport
    • of

      public static ProductImportBuilder of()
      factory method for an instance of ProductImportBuilder
      Returns:
      builder
    • of

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