Interface ProductSetAttributeInAllVariantsAction

All Superinterfaces:
ProductUpdateAction, ResourceUpdateAction<ProductUpdateAction>

public interface ProductSetAttributeInAllVariantsAction extends ProductUpdateAction

Adds, removes, or changes a Product Attribute in all Product Variants at the same time. This action is useful for setting values for Attributes with the Constraint SameForAll.


Example to create an instance using the builder pattern

     ProductSetAttributeInAllVariantsAction productSetAttributeInAllVariantsAction = ProductSetAttributeInAllVariantsAction.builder()
             .name("{name}")
             .build()
 
  • Field Details

    • SET_ATTRIBUTE_IN_ALL_VARIANTS

      static final String SET_ATTRIBUTE_IN_ALL_VARIANTS
      discriminator value for ProductSetAttributeInAllVariantsAction
      See Also:
  • Method Details

    • getName

      @NotNull @NotNull String getName()

      The name of the Attribute to set.

      Returns:
      name
    • getValue

      Object getValue()

      Value to set for the Attributes. 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

      Boolean getStaged()

      If true, only the staged Attributes are set. If false, both the current and staged Attributes are set.

      Returns:
      staged
    • setName

      void setName(String name)

      The name of the Attribute to set.

      Parameters:
      name - value to be set
    • setValue

      void setValue(Object value)

      Value to set for the Attributes. 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
    • setStaged

      void setStaged(Boolean staged)

      If true, only the staged Attributes are set. If false, both the current and staged Attributes are set.

      Parameters:
      staged - value to be set
    • of

      factory method
      Returns:
      instance of ProductSetAttributeInAllVariantsAction
    • of

      factory method to create a shallow copy ProductSetAttributeInAllVariantsAction
      Parameters:
      template - instance to be copied
      Returns:
      copy instance
    • deepCopy

      factory method to create a deep copy of ProductSetAttributeInAllVariantsAction
      Parameters:
      template - instance to be copied
      Returns:
      copy instance
    • builder

      builder factory method for ProductSetAttributeInAllVariantsAction
      Returns:
      builder
    • builder

      create builder for ProductSetAttributeInAllVariantsAction instance
      Parameters:
      template - instance with prefilled values for the builder
      Returns:
      builder
    • withProductSetAttributeInAllVariantsAction

      default <T> T withProductSetAttributeInAllVariantsAction(Function<ProductSetAttributeInAllVariantsAction,T> helper)
      accessor map function
      Type Parameters:
      T - mapped type
      Parameters:
      helper - function to map the object
      Returns:
      mapped value
    • ofUnsetAttribute

      static ProductSetAttributeInAllVariantsAction ofUnsetAttribute(String name)
    • ofUnsetAttribute

      static ProductSetAttributeInAllVariantsAction ofUnsetAttribute(String name, Boolean staged)
    • typeReference

      static com.fasterxml.jackson.core.type.TypeReference<ProductSetAttributeInAllVariantsAction> typeReference()
      gives a TypeReference for usage with Jackson DataBind
      Returns:
      TypeReference