Class CartDiscountValueGiftLineItemDraftBuilder
- All Implemented Interfaces:
Builder<CartDiscountValueGiftLineItemDraft>
Example to create an instance using the builder pattern
CartDiscountValueGiftLineItemDraft cartDiscountValueGiftLineItemDraft = CartDiscountValueGiftLineItemDraft.builder()
.product(productBuilder -> productBuilder)
.variantId(0.3)
.build()
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()builds CartDiscountValueGiftLineItemDraft with checking for non-null required valuesbuilds CartDiscountValueGiftLineItemDraft without checking for non-null required valuesdistributionChannel(ChannelResourceIdentifier distributionChannel) Channel must have the roleProductDistribution.distributionChannel(Function<ChannelResourceIdentifierBuilder, ChannelResourceIdentifierBuilder> builder) Channel must have the roleProductDistribution.Channel must have the roleProductDistribution.ResourceIdentifier of a Product.Channel must have the roleInventorySupply.ProductVariant of the Product.of()factory method for an instance of CartDiscountValueGiftLineItemDraftBuilderof(CartDiscountValueGiftLineItemDraft template) create builder for CartDiscountValueGiftLineItemDraft instanceproduct(ProductResourceIdentifier product) ResourceIdentifier of a Product.ResourceIdentifier of a Product.supplyChannel(ChannelResourceIdentifier supplyChannel) Channel must have the roleInventorySupply.Channel must have the roleInventorySupply.ProductVariant of the Product.withDistributionChannel(Function<ChannelResourceIdentifierBuilder, ChannelResourceIdentifier> builder) Channel must have the roleProductDistribution.ResourceIdentifier of a Product.Channel must have the roleInventorySupply.
-
Constructor Details
-
CartDiscountValueGiftLineItemDraftBuilder
public CartDiscountValueGiftLineItemDraftBuilder()
-
-
Method Details
-
product
public CartDiscountValueGiftLineItemDraftBuilder product(Function<ProductResourceIdentifierBuilder, ProductResourceIdentifierBuilder> builder) ResourceIdentifier of a Product.
A Gift Line Item is added to a Cart even if the referenced Product is unpublished.
- Parameters:
builder- function to build the product value- Returns:
- Builder
-
withProduct
public CartDiscountValueGiftLineItemDraftBuilder withProduct(Function<ProductResourceIdentifierBuilder, ProductResourceIdentifier> builder) ResourceIdentifier of a Product.
A Gift Line Item is added to a Cart even if the referenced Product is unpublished.
- Parameters:
builder- function to build the product value- Returns:
- Builder
-
product
ResourceIdentifier of a Product.
A Gift Line Item is added to a Cart even if the referenced Product is unpublished.
- Parameters:
product- value to be set- Returns:
- Builder
-
variantId
ProductVariant of the Product.
- Parameters:
variantId- value to be set- Returns:
- Builder
-
supplyChannel
public CartDiscountValueGiftLineItemDraftBuilder supplyChannel(Function<ChannelResourceIdentifierBuilder, ChannelResourceIdentifierBuilder> builder) Channel must have the role
InventorySupply.- Parameters:
builder- function to build the supplyChannel value- Returns:
- Builder
-
withSupplyChannel
public CartDiscountValueGiftLineItemDraftBuilder withSupplyChannel(Function<ChannelResourceIdentifierBuilder, ChannelResourceIdentifier> builder) Channel must have the role
InventorySupply.- Parameters:
builder- function to build the supplyChannel value- Returns:
- Builder
-
supplyChannel
public CartDiscountValueGiftLineItemDraftBuilder supplyChannel(@Nullable ChannelResourceIdentifier supplyChannel) Channel must have the role
InventorySupply.- Parameters:
supplyChannel- value to be set- Returns:
- Builder
-
distributionChannel
public CartDiscountValueGiftLineItemDraftBuilder distributionChannel(Function<ChannelResourceIdentifierBuilder, ChannelResourceIdentifierBuilder> builder) Channel must have the role
ProductDistribution.- Parameters:
builder- function to build the distributionChannel value- Returns:
- Builder
-
withDistributionChannel
public CartDiscountValueGiftLineItemDraftBuilder withDistributionChannel(Function<ChannelResourceIdentifierBuilder, ChannelResourceIdentifier> builder) Channel must have the role
ProductDistribution.- Parameters:
builder- function to build the distributionChannel value- Returns:
- Builder
-
distributionChannel
public CartDiscountValueGiftLineItemDraftBuilder distributionChannel(@Nullable ChannelResourceIdentifier distributionChannel) Channel must have the role
ProductDistribution.- Parameters:
distributionChannel- value to be set- Returns:
- Builder
-
getProduct
ResourceIdentifier of a Product.
A Gift Line Item is added to a Cart even if the referenced Product is unpublished.
- Returns:
- product
-
getVariantId
ProductVariant of the Product.
- Returns:
- variantId
-
getSupplyChannel
Channel must have the role
InventorySupply.- Returns:
- supplyChannel
-
getDistributionChannel
Channel must have the role
ProductDistribution.- Returns:
- distributionChannel
-
build
builds CartDiscountValueGiftLineItemDraft with checking for non-null required values- Specified by:
buildin interfaceBuilder<CartDiscountValueGiftLineItemDraft>- Returns:
- CartDiscountValueGiftLineItemDraft
-
buildUnchecked
builds CartDiscountValueGiftLineItemDraft without checking for non-null required values- Returns:
- CartDiscountValueGiftLineItemDraft
-
of
factory method for an instance of CartDiscountValueGiftLineItemDraftBuilder- Returns:
- builder
-
of
public static CartDiscountValueGiftLineItemDraftBuilder of(CartDiscountValueGiftLineItemDraft template) create builder for CartDiscountValueGiftLineItemDraft instance- Parameters:
template- instance with prefilled values for the builder- Returns:
- builder
-