Class VariantSetAttributeActionBuilder
java.lang.Object
com.commercetools.api.models.variant.VariantSetAttributeActionBuilder
- All Implemented Interfaces:
Builder<VariantSetAttributeAction>
public class VariantSetAttributeActionBuilder
extends Object
implements Builder<VariantSetAttributeAction>
VariantSetAttributeActionBuilder
Example to create an instance using the builder pattern
Example to create an instance using the builder pattern
VariantSetAttributeAction variantSetAttributeAction = VariantSetAttributeAction.builder()
.name("{name}")
.build()
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()builds VariantSetAttributeAction with checking for non-null required valuesbuilds VariantSetAttributeAction without checking for non-null required valuesgetName()Name of the Attribute to set.Iftrue, only the staged Attribute is set.getValue()Value to set for the Attribute.Name of the Attribute to set.of()factory method for an instance of VariantSetAttributeActionBuilderof(VariantSetAttributeAction template) create builder for VariantSetAttributeAction instanceIftrue, only the staged Attribute is set.Value to set for the Attribute.
-
Constructor Details
-
VariantSetAttributeActionBuilder
public VariantSetAttributeActionBuilder()
-
-
Method Details
-
name
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
valueto be provided:- For Enum Type and Localized Enum Type, use the
keyof the Plain Enum Value or Localized Enum Value object or the complete object asvalue. - 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
setobject asvalue. - For Nested Type Attributes, use the list of values of all Attributes of the nested Variant as
value. - For Reference Type Attributes, use the Reference object as
value.
- Parameters:
value- value to be set- Returns:
- Builder
- For Enum Type and Localized Enum Type, use the
-
staged
If
true, only the staged Attribute is set. Iffalse, both the current and staged Attributes are set.- Parameters:
staged- value to be set- Returns:
- Builder
-
getName
Name of the Attribute to set.
- Returns:
- name
-
getValue
Value to set for the Attribute. If empty, any existing value will be removed.
The AttributeType determines the format of the Attribute
valueto be provided:- For Enum Type and Localized Enum Type, use the
keyof the Plain Enum Value or Localized Enum Value object or the complete object asvalue. - 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
setobject asvalue. - For Nested Type Attributes, use the list of values of all Attributes of the nested Variant as
value. - For Reference Type Attributes, use the Reference object as
value.
- Returns:
- value
- For Enum Type and Localized Enum Type, use the
-
getStaged
If
true, only the staged Attribute is set. Iffalse, both the current and staged Attributes are set.- Returns:
- staged
-
build
builds VariantSetAttributeAction with checking for non-null required values- Specified by:
buildin interfaceBuilder<VariantSetAttributeAction>- Returns:
- VariantSetAttributeAction
-
buildUnchecked
builds VariantSetAttributeAction without checking for non-null required values- Returns:
- VariantSetAttributeAction
-
of
factory method for an instance of VariantSetAttributeActionBuilder- Returns:
- builder
-
of
create builder for VariantSetAttributeAction instance- Parameters:
template- instance with prefilled values for the builder- Returns:
- builder
-