Class AttributeBuilder
java.lang.Object
com.commercetools.api.models.product.AttributeBuilder
AttributeBuilder
Example to create an instance using the builder pattern
Example to create an instance using the builder pattern
Attribute attribute = Attribute.builder()
.name("{name}")
.build()
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
builds Attribute with checking for non-null required valuesbuilds Attribute without checking for non-null required valuesgetName()
Name of the Attribute.getValue()
The AttributeType determines the format of the Attributevalue
to be provided:Name of the Attribute.static AttributeBuilder
of()
factory method for an instance of AttributeBuilderstatic AttributeBuilder
create builder for Attribute instanceThe AttributeType determines the format of the Attributevalue
to be provided:
-
Constructor Details
-
AttributeBuilder
public AttributeBuilder()
-
-
Method Details
-
name
Name of the Attribute.
- Parameters:
name
- value to be set- Returns:
- Builder
-
value
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 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
set
object asvalue
. - 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
- For Enum Type and Localized Enum Type, use the
-
getName
Name of the Attribute.
- Returns:
- name
-
getValue
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 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
set
object asvalue
. - 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
- For Enum Type and Localized Enum Type, use the
-
build
builds Attribute with checking for non-null required values -
buildUnchecked
builds Attribute without checking for non-null required values- Returns:
- Attribute
-
of
factory method for an instance of AttributeBuilder- Returns:
- builder
-
of
create builder for Attribute instance- Parameters:
template
- instance with prefilled values for the builder- Returns:
- builder
-