Class ProductVariantPatchBuilder

java.lang.Object
com.commercetools.importapi.models.productvariants.ProductVariantPatchBuilder
All Implemented Interfaces:
io.vrap.rmf.base.client.Builder<ProductVariantPatch>

public class ProductVariantPatchBuilder extends Object implements io.vrap.rmf.base.client.Builder<ProductVariantPatch>
ProductVariantPatchBuilder
Example to create an instance using the builder pattern

     ProductVariantPatch productVariantPatch = ProductVariantPatch.builder()
             .productVariant(productVariantBuilder -> productVariantBuilder)
             .build()
 
  • Constructor Details

  • Method Details

    • productVariant

      The ProductVariant to which this patch is applied. The Reference to the ProductVariant with which the ProductVariantPatch is associated. If referenced ProductVariant does not exist, the state of the ImportOperation will be set to unresolved until the necessary ProductVariant is created.

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

      The ProductVariant to which this patch is applied. The Reference to the ProductVariant with which the ProductVariantPatch is associated. If referenced ProductVariant does not exist, the state of the ImportOperation will be set to unresolved until the necessary ProductVariant is created.

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

      The ProductVariant to which this patch is applied. The Reference to the ProductVariant with which the ProductVariantPatch is associated. If referenced ProductVariant does not exist, the state of the ImportOperation will be set to unresolved until the necessary ProductVariant is created.

      Parameters:
      productVariant - value to be set
      Returns:
      Builder
    • attributes

      Maps to ProductVariant.attributes.

      • The referenced Attribute must be defined in an existing ProductType, or the state of the ImportOperation will be validationFailed.
      • Setting the value of a non-required Attribute to null will remove the Attribute.
      • Attempting to set a null value to a required Attribute will make the import operation fail with an InvalidOperation error.
      • Importing LocalizableTextAttributes or LocalizableTextSetAttributes follows an override pattern, meaning that omitted localized fields will be deleted, new fields will be created, and existing fields will be updated. You can also delete localized fields by setting their value to null.
      Parameters:
      builder - function to build the attributes value
      Returns:
      Builder
    • withAttributes

      Maps to ProductVariant.attributes.

      • The referenced Attribute must be defined in an existing ProductType, or the state of the ImportOperation will be validationFailed.
      • Setting the value of a non-required Attribute to null will remove the Attribute.
      • Attempting to set a null value to a required Attribute will make the import operation fail with an InvalidOperation error.
      • Importing LocalizableTextAttributes or LocalizableTextSetAttributes follows an override pattern, meaning that omitted localized fields will be deleted, new fields will be created, and existing fields will be updated. You can also delete localized fields by setting their value to null.
      Parameters:
      builder - function to build the attributes value
      Returns:
      Builder
    • attributes

      Maps to ProductVariant.attributes.

      • The referenced Attribute must be defined in an existing ProductType, or the state of the ImportOperation will be validationFailed.
      • Setting the value of a non-required Attribute to null will remove the Attribute.
      • Attempting to set a null value to a required Attribute will make the import operation fail with an InvalidOperation error.
      • Importing LocalizableTextAttributes or LocalizableTextSetAttributes follows an override pattern, meaning that omitted localized fields will be deleted, new fields will be created, and existing fields will be updated. You can also delete localized fields by setting their value to null.
      Parameters:
      attributes - value to be set
      Returns:
      Builder
    • staged

      If false, the attribute changes are applied to both current and staged projected representations of the Product.

      Parameters:
      staged - value to be set
      Returns:
      Builder
    • getProductVariant

      The ProductVariant to which this patch is applied. The Reference to the ProductVariant with which the ProductVariantPatch is associated. If referenced ProductVariant does not exist, the state of the ImportOperation will be set to unresolved until the necessary ProductVariant is created.

      Returns:
      productVariant
    • getAttributes

      Maps to ProductVariant.attributes.

      • The referenced Attribute must be defined in an existing ProductType, or the state of the ImportOperation will be validationFailed.
      • Setting the value of a non-required Attribute to null will remove the Attribute.
      • Attempting to set a null value to a required Attribute will make the import operation fail with an InvalidOperation error.
      • Importing LocalizableTextAttributes or LocalizableTextSetAttributes follows an override pattern, meaning that omitted localized fields will be deleted, new fields will be created, and existing fields will be updated. You can also delete localized fields by setting their value to null.
      Returns:
      attributes
    • getStaged

      If false, the attribute changes are applied to both current and staged projected representations of the Product.

      Returns:
      staged
    • build

      builds ProductVariantPatch with checking for non-null required values
      Specified by:
      build in interface io.vrap.rmf.base.client.Builder<ProductVariantPatch>
      Returns:
      ProductVariantPatch
    • buildUnchecked

      builds ProductVariantPatch without checking for non-null required values
      Returns:
      ProductVariantPatch
    • of

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

      create builder for ProductVariantPatch instance
      Parameters:
      template - instance with prefilled values for the builder
      Returns:
      builder