Class ProductSetAttributeActionBuilder

java.lang.Object
com.commercetools.api.models.product.ProductSetAttributeActionBuilder
All Implemented Interfaces:
Builder<ProductSetAttributeAction>

public class ProductSetAttributeActionBuilder extends Object implements Builder<ProductSetAttributeAction>
ProductSetAttributeActionBuilder
Example to create an instance using the builder pattern

     ProductSetAttributeAction productSetAttributeAction = ProductSetAttributeAction.builder()
             .name("{name}")
             .build()
 
  • Constructor Details

    • ProductSetAttributeActionBuilder

      public ProductSetAttributeActionBuilder()
  • Method Details

    • variantId

      public ProductSetAttributeActionBuilder variantId(@Nullable Long variantId)

      The id of the ProductVariant to update.

      Parameters:
      variantId - value to be set
      Returns:
      Builder
    • sku

      The sku of the ProductVariant to update.

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

      The name of the Attribute to set.

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

      Value to set for the Attribute. If empty, any existing value will be removed.

      The AttributeType determines the format of the Attribute value to be provided:

      • For Enum Type and Localized Enum Type, use the key of the Plain Enum Value or Localized Enum Value objects, or the complete objects as value.
      • For Localizable Text Type, use the LocalizedString object as value.
      • For Money Type Attributes, use the Money object as value.
      • For Set Type Attributes, use the entire set object as value.
      • For Nested Type Attributes, use the list of values of all Attributes of the nested Product as value.
      • For Reference Type Attributes, use the Reference object as value.
      Parameters:
      value - value to be set
      Returns:
      Builder
    • staged

      If true, only the staged Attribute is set. If false, both current and staged Attribute is set.

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

      @Nullable public Long getVariantId()

      The id of the ProductVariant to update.

      Returns:
      variantId
    • getSku

      @Nullable public String getSku()

      The sku of the ProductVariant to update.

      Returns:
      sku
    • getName

      public String getName()

      The name of the Attribute to set.

      Returns:
      name
    • getValue

      @Nullable public Object getValue()

      Value to set for the Attribute. If empty, any existing value will be removed.

      The AttributeType determines the format of the Attribute value to be provided:

      • For Enum Type and Localized Enum Type, use the key of the Plain Enum Value or Localized Enum Value objects, or the complete objects as value.
      • For Localizable Text Type, use the LocalizedString object as value.
      • For Money Type Attributes, use the Money object as value.
      • For Set Type Attributes, use the entire set object as value.
      • For Nested Type Attributes, use the list of values of all Attributes of the nested Product as value.
      • For Reference Type Attributes, use the Reference object as value.
      Returns:
      value
    • getStaged

      @Nullable public Boolean getStaged()

      If true, only the staged Attribute is set. If false, both current and staged Attribute is set.

      Returns:
      staged
    • build

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

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

      factory method for an instance of ProductSetAttributeActionBuilder
      Returns:
      builder
    • of

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