Class ReferenceAttributeBuilder
java.lang.Object
com.commercetools.importapi.models.productvariants.ReferenceAttributeBuilder
- All Implemented Interfaces:
Builder<ReferenceAttribute>
ReferenceAttributeBuilder
Example to create an instance using the builder pattern
Example to create an instance using the builder pattern
ReferenceAttribute referenceAttribute = ReferenceAttribute.builder()
.value(valueBuilder -> valueBuilder)
.build()
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
builds ReferenceAttribute with checking for non-null required valuesbuilds ReferenceAttribute without checking for non-null required valuesgetName()
The name of this attribute must match a name of the product types attribute definitions.getValue()
References a resource by key.The name of this attribute must match a name of the product types attribute definitions.static ReferenceAttributeBuilder
of()
factory method for an instance of ReferenceAttributeBuilderstatic ReferenceAttributeBuilder
of
(ReferenceAttribute template) create builder for ReferenceAttribute instancevalue
(KeyReference value) References a resource by key.value
(Function<KeyReferenceBuilder, Builder<? extends KeyReference>> builder) References a resource by key.
-
Constructor Details
-
ReferenceAttributeBuilder
public ReferenceAttributeBuilder()
-
-
Method Details
-
name
The name of this attribute must match a name of the product types attribute definitions. The name is required if this type is used in a product variant and must not be set when used in a product variant patch.
- Parameters:
name
- value to be set- Returns:
- Builder
-
value
References a resource by key.
- Parameters:
value
- value to be set- Returns:
- Builder
-
value
public ReferenceAttributeBuilder value(Function<KeyReferenceBuilder, Builder<? extends KeyReference>> builder) References a resource by key.
- Parameters:
builder
- function to build the value value- Returns:
- Builder
-
getName
The name of this attribute must match a name of the product types attribute definitions. The name is required if this type is used in a product variant and must not be set when used in a product variant patch.
- Returns:
- name
-
getValue
References a resource by key.
- Returns:
- value
-
build
builds ReferenceAttribute with checking for non-null required values- Specified by:
build
in interfaceBuilder<ReferenceAttribute>
- Returns:
- ReferenceAttribute
-
buildUnchecked
builds ReferenceAttribute without checking for non-null required values- Returns:
- ReferenceAttribute
-
of
factory method for an instance of ReferenceAttributeBuilder- Returns:
- builder
-
of
create builder for ReferenceAttribute instance- Parameters:
template
- instance with prefilled values for the builder- Returns:
- builder
-