Class ProductReferenceBuilder
java.lang.Object
com.commercetools.api.models.product.ProductReferenceBuilder
- All Implemented Interfaces:
Builder<ProductReference>
ProductReferenceBuilder
Example to create an instance using the builder pattern
Example to create an instance using the builder pattern
ProductReference productReference = ProductReference.builder()
.id("{id}")
.build()
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
builds ProductReference with checking for non-null required valuesbuilds ProductReference without checking for non-null required valuesgetId()
Unique identifier of the referenced Product.getObj()
Contains the representation of the expanded Product.Unique identifier of the referenced Product.Contains the representation of the expanded Product.obj
(Function<ProductBuilder, ProductBuilder> builder) Contains the representation of the expanded Product.static ProductReferenceBuilder
of()
factory method for an instance of ProductReferenceBuilderstatic ProductReferenceBuilder
of
(ProductReference template) create builder for ProductReference instancewithObj
(Function<ProductBuilder, Product> builder) Contains the representation of the expanded Product.
-
Constructor Details
-
ProductReferenceBuilder
public ProductReferenceBuilder()
-
-
Method Details
-
id
Unique identifier of the referenced Product.
- Parameters:
id
- value to be set- Returns:
- Builder
-
obj
Contains the representation of the expanded Product. Only present in responses to requests with Reference Expansion for Products.
- Parameters:
builder
- function to build the obj value- Returns:
- Builder
-
withObj
Contains the representation of the expanded Product. Only present in responses to requests with Reference Expansion for Products.
- Parameters:
builder
- function to build the obj value- Returns:
- Builder
-
obj
Contains the representation of the expanded Product. Only present in responses to requests with Reference Expansion for Products.
- Parameters:
obj
- value to be set- Returns:
- Builder
-
getId
Unique identifier of the referenced Product.
- Returns:
- id
-
getObj
Contains the representation of the expanded Product. Only present in responses to requests with Reference Expansion for Products.
- Returns:
- obj
-
build
builds ProductReference with checking for non-null required values- Specified by:
build
in interfaceBuilder<ProductReference>
- Returns:
- ProductReference
-
buildUnchecked
builds ProductReference without checking for non-null required values- Returns:
- ProductReference
-
of
factory method for an instance of ProductReferenceBuilder- Returns:
- builder
-
of
create builder for ProductReference instance- Parameters:
template
- instance with prefilled values for the builder- Returns:
- builder
-