Class ProductVariantPatchImpl

java.lang.Object
com.commercetools.importapi.models.productvariants.ProductVariantPatchImpl
All Implemented Interfaces:
ProductVariantPatch, io.vrap.rmf.base.client.ModelBase

public class ProductVariantPatchImpl extends Object implements ProductVariantPatch, io.vrap.rmf.base.client.ModelBase

Representation for an update of a ProductVariant. Use this type to import updates for existing ProductVariants in a Project.

  • Constructor Details

    • ProductVariantPatchImpl

      public ProductVariantPatchImpl()
      create empty instance
  • Method Details

    • getProductVariant

      public ProductVariantKeyReference getProductVariant()

      Reference to the ProductVariant to update. If the referenced ProductVariant does not exist, the state of the ImportOperation will be set to unresolved until the necessary ProductVariant is created.

      Specified by:
      getProductVariant in interface ProductVariantPatch
      Returns:
      productVariant
    • getAttributes

      public Attributes 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.
      Specified by:
      getAttributes in interface ProductVariantPatch
      Returns:
      attributes
    • getStaged

      public Boolean getStaged()

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

      Specified by:
      getStaged in interface ProductVariantPatch
      Returns:
      staged
    • getProduct

      public ProductKeyReference getProduct()

      Reference to the Product which contains the ProductVariant. Setting a value will batch process the import operations to minimize concurrency errors. If set, this field is required for every ProductVariantPatch in the ProductVariantPatchRequest.

      Specified by:
      getProduct in interface ProductVariantPatch
      Returns:
      product
    • setProductVariant

      public void setProductVariant(ProductVariantKeyReference productVariant)
      Description copied from interface: ProductVariantPatch

      Reference to the ProductVariant to update. If the referenced ProductVariant does not exist, the state of the ImportOperation will be set to unresolved until the necessary ProductVariant is created.

      Specified by:
      setProductVariant in interface ProductVariantPatch
      Parameters:
      productVariant - value to be set
    • setAttributes

      public void setAttributes(Attributes attributes)
      Description copied from interface: ProductVariantPatch

      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.
      Specified by:
      setAttributes in interface ProductVariantPatch
      Parameters:
      attributes - value to be set
    • setStaged

      public void setStaged(Boolean staged)
      Description copied from interface: ProductVariantPatch

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

      Specified by:
      setStaged in interface ProductVariantPatch
      Parameters:
      staged - value to be set
    • setProduct

      public void setProduct(ProductKeyReference product)
      Description copied from interface: ProductVariantPatch

      Reference to the Product which contains the ProductVariant. Setting a value will batch process the import operations to minimize concurrency errors. If set, this field is required for every ProductVariantPatch in the ProductVariantPatchRequest.

      Specified by:
      setProduct in interface ProductVariantPatch
      Parameters:
      product - 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