Interface CartDiscountValueGiftLineItemDraft
- All Superinterfaces:
CartDiscountValueDraft
,Draft<CartDiscountValueGiftLineItemDraft>
public interface CartDiscountValueGiftLineItemDraft
extends CartDiscountValueDraft, Draft<CartDiscountValueGiftLineItemDraft>
Can only be used in a CartDiscountDraft with no target
specified. Hence, this type can not be used in the Change Value update action.
Example to create an instance using the builder pattern
CartDiscountValueGiftLineItemDraft cartDiscountValueGiftLineItemDraft = CartDiscountValueGiftLineItemDraft.builder()
.product(productBuilder -> productBuilder)
.variantId(0.3)
.build()
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
discriminator value for CartDiscountValueGiftLineItemDraft -
Method Summary
Modifier and TypeMethodDescriptionbuilder()
builder factory method for CartDiscountValueGiftLineItemDraftbuilder
(CartDiscountValueGiftLineItemDraft template) create builder for CartDiscountValueGiftLineItemDraft instancedeepCopy
(CartDiscountValueGiftLineItemDraft template) factory method to create a deep copy of CartDiscountValueGiftLineItemDraft@Valid ChannelResourceIdentifier
Channel must have the roleProductDistribution
.@NotNull @Valid ProductResourceIdentifier
ResourceIdentifier of a Product.@Valid ChannelResourceIdentifier
Channel must have the roleInventorySupply
.@NotNull Long
ProductVariant of the Product.of()
factory methodof
(CartDiscountValueGiftLineItemDraft template) factory method to create a shallow copy CartDiscountValueGiftLineItemDraftvoid
setDistributionChannel
(ChannelResourceIdentifier distributionChannel) Channel must have the roleProductDistribution
.void
setProduct
(ProductResourceIdentifier product) ResourceIdentifier of a Product.void
setSupplyChannel
(ChannelResourceIdentifier supplyChannel) Channel must have the roleInventorySupply
.void
setVariantId
(Long variantId) ProductVariant of the Product.static com.fasterxml.jackson.core.type.TypeReference<CartDiscountValueGiftLineItemDraft>
gives a TypeReference for usage with Jackson DataBinddefault <T> T
accessor map functionMethods inherited from interface com.commercetools.api.models.cart_discount.CartDiscountValueDraft
getType, withCartDiscountValueDraft
-
Field Details
-
GIFT_LINE_ITEM
discriminator value for CartDiscountValueGiftLineItemDraft- See Also:
-
-
Method Details
-
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
-
setProduct
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
-
setVariantId
ProductVariant of the Product.
- Parameters:
variantId
- value to be set
-
setSupplyChannel
Channel must have the role
InventorySupply
.- Parameters:
supplyChannel
- value to be set
-
setDistributionChannel
Channel must have the role
ProductDistribution
.- Parameters:
distributionChannel
- value to be set
-
of
factory method- Returns:
- instance of CartDiscountValueGiftLineItemDraft
-
of
factory method to create a shallow copy CartDiscountValueGiftLineItemDraft- Parameters:
template
- instance to be copied- Returns:
- copy instance
-
deepCopy
@Nullable static CartDiscountValueGiftLineItemDraft deepCopy(@Nullable CartDiscountValueGiftLineItemDraft template) factory method to create a deep copy of CartDiscountValueGiftLineItemDraft- Parameters:
template
- instance to be copied- Returns:
- copy instance
-
builder
builder factory method for CartDiscountValueGiftLineItemDraft- Returns:
- builder
-
builder
static CartDiscountValueGiftLineItemDraftBuilder builder(CartDiscountValueGiftLineItemDraft template) create builder for CartDiscountValueGiftLineItemDraft instance- Parameters:
template
- instance with prefilled values for the builder- Returns:
- builder
-
withCartDiscountValueGiftLineItemDraft
default <T> T withCartDiscountValueGiftLineItemDraft(Function<CartDiscountValueGiftLineItemDraft, T> helper) accessor map function- Type Parameters:
T
- mapped type- Parameters:
helper
- function to map the object- Returns:
- mapped value
-
typeReference
static com.fasterxml.jackson.core.type.TypeReference<CartDiscountValueGiftLineItemDraft> typeReference()gives a TypeReference for usage with Jackson DataBind- Returns:
- TypeReference
-