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
Constructors -
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 AttributeValueBuilderof()factory method for an instance of AttributeValueBuilderstatic AttributeValueBuilderof(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,
valueis thekeyof the Plain Enum Value or Localized Enum Value objects, or the complete objects. - For Localizable Text Type,
valueis the LocalizedString object. - For Money Type Attributes,
valueis the Money object. - For Set Type Attributes,
valueis the entiresetobject. - For Nested Type Attributes,
valueis the list of values of all Attributes of the nested Product. - For Reference Type Attributes,
valueis 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,
valueis thekeyof the Plain Enum Value or Localized Enum Value objects, or the complete objects. - For Localizable Text Type,
valueis the LocalizedString object. - For Money Type Attributes,
valueis the Money object. - For Set Type Attributes,
valueis the entiresetobject. - For Nested Type Attributes,
valueis the list of values of all Attributes of the nested Product. - For Reference Type Attributes,
valueis the Reference object.
- Returns:
- value
- For Enum Type and Localized Enum Type,
-
build
builds AttributeValue with checking for non-null required values- Specified by:
buildin 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
-