Class AttributeValueBuilder
java.lang.Object
com.commercetools.history.models.change_value.AttributeValueBuilder
- All Implemented Interfaces:
Builder<AttributeValue>
AttributeValueBuilder
Example to create an instance using the builder pattern
Example to create an instance using the builder pattern
AttributeValue attributeValue = AttributeValue.builder()
.name("{name}")
.build()
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
builds AttributeValue with checking for non-null required valuesbuilds AttributeValue without checking for non-null required valuesgetName()
Name of the Attribute set.getValue()
Value set for the Attribute determined by the AttributeType:Name of the Attribute set.static AttributeValueBuilder
of()
factory method for an instance of AttributeValueBuilderstatic AttributeValueBuilder
of
(AttributeValue template) create builder for AttributeValue instanceValue set for the Attribute determined by the AttributeType:
-
Constructor Details
-
AttributeValueBuilder
public AttributeValueBuilder()
-
-
Method Details
-
name
Name of the Attribute set.
- Parameters:
name
- value to be set- Returns:
- Builder
-
value
Value set for the Attribute determined by the AttributeType:
- For Enum Type and Localized Enum Type,
value
is thekey
of the Plain Enum Value or Localized Enum Value objects, or the complete objects. - For Localizable Text Type,
value
is the LocalizedString object. - For Money Type Attributes,
value
is the Money object. - For Set Type Attributes,
value
is the entireset
object. - For Nested Type Attributes,
value
is the list of values of all Attributes of the nested Product. - For Reference Type Attributes,
value
is the Reference object.
- Parameters:
value
- value to be set- Returns:
- Builder
- For Enum Type and Localized Enum Type,
-
getName
Name of the Attribute set.
- Returns:
- name
-
getValue
Value set for the Attribute determined by the AttributeType:
- For Enum Type and Localized Enum Type,
value
is thekey
of the Plain Enum Value or Localized Enum Value objects, or the complete objects. - For Localizable Text Type,
value
is the LocalizedString object. - For Money Type Attributes,
value
is the Money object. - For Set Type Attributes,
value
is the entireset
object. - For Nested Type Attributes,
value
is the list of values of all Attributes of the nested Product. - For Reference Type Attributes,
value
is the Reference object.
- Returns:
- value
- For Enum Type and Localized Enum Type,
-
build
builds AttributeValue with checking for non-null required values- Specified by:
build
in interfaceBuilder<AttributeValue>
- Returns:
- AttributeValue
-
buildUnchecked
builds AttributeValue without checking for non-null required values- Returns:
- AttributeValue
-
of
factory method for an instance of AttributeValueBuilder- Returns:
- builder
-
of
create builder for AttributeValue instance- Parameters:
template
- instance with prefilled values for the builder- Returns:
- builder
-