Interface CartDiscountValueGiftLineItem
- All Superinterfaces:
CartDiscountValue,CartDiscountValueGiftLineItemMixin,CartDiscountValueMixin,GenericCartDiscountValueMixin<CartDiscountValueGiftLineItemDraft>
public interface CartDiscountValueGiftLineItem
extends CartDiscountValue, CartDiscountValueGiftLineItemMixin
CartDiscountValueGiftLineItem
Example to create an instance using the builder pattern
Example to create an instance using the builder pattern
CartDiscountValueGiftLineItem cartDiscountValueGiftLineItem = CartDiscountValueGiftLineItem.builder()
.product(productBuilder -> productBuilder)
.variantId(0.3)
.build()
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringdiscriminator value for CartDiscountValueGiftLineItem -
Method Summary
Modifier and TypeMethodDescriptionbuilder()builder factory method for CartDiscountValueGiftLineItembuilder(CartDiscountValueGiftLineItem template) create builder for CartDiscountValueGiftLineItem instancecopyDeep()deepCopy(CartDiscountValueGiftLineItem template) factory method to create a deep copy of CartDiscountValueGiftLineItem@Valid ChannelReferenceChannel must have the ChannelRoleEnumProductDistribution.@NotNull @Valid ProductReferenceReference to a Product.@Valid ChannelReferenceChannel must have the ChannelRoleEnumInventorySupply.@NotNull LongProductVariant of the Product.of()factory methodof(CartDiscountValueGiftLineItem template) factory method to create a shallow copy CartDiscountValueGiftLineItemvoidsetDistributionChannel(ChannelReference distributionChannel) Channel must have the ChannelRoleEnumProductDistribution.voidsetProduct(ProductReference product) Reference to a Product.voidsetSupplyChannel(ChannelReference supplyChannel) Channel must have the ChannelRoleEnumInventorySupply.voidsetVariantId(Long variantId) ProductVariant of the Product.static com.fasterxml.jackson.core.type.TypeReference<CartDiscountValueGiftLineItem>gives a TypeReference for usage with Jackson DataBinddefault <T> Taccessor map functionMethods inherited from interface com.commercetools.api.models.cart_discount.CartDiscountValue
getType, withCartDiscountValueMethods inherited from interface com.commercetools.api.models.cart_discount.CartDiscountValueGiftLineItemMixin
toDraft, toDraftBuilder
-
Field Details
-
GIFT_LINE_ITEM
discriminator value for CartDiscountValueGiftLineItem- See Also:
-
-
Method Details
-
getProduct
Reference to a Product.
A Gift Line Item can be present on a Cart even if the referenced Product is unpublished.
- Specified by:
getProductin interfaceCartDiscountValueGiftLineItemMixin- Returns:
- product
-
getVariantId
ProductVariant of the Product.
- Specified by:
getVariantIdin interfaceCartDiscountValueGiftLineItemMixin- Returns:
- variantId
-
getSupplyChannel
Channel must have the ChannelRoleEnum
InventorySupply.- Specified by:
getSupplyChannelin interfaceCartDiscountValueGiftLineItemMixin- Returns:
- supplyChannel
-
getDistributionChannel
Channel must have the ChannelRoleEnum
ProductDistribution.- Specified by:
getDistributionChannelin interfaceCartDiscountValueGiftLineItemMixin- Returns:
- distributionChannel
-
setProduct
Reference to a Product.
A Gift Line Item can be present on 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 ChannelRoleEnum
InventorySupply.- Parameters:
supplyChannel- value to be set
-
setDistributionChannel
Channel must have the ChannelRoleEnum
ProductDistribution.- Parameters:
distributionChannel- value to be set
-
of
factory method- Returns:
- instance of CartDiscountValueGiftLineItem
-
of
factory method to create a shallow copy CartDiscountValueGiftLineItem- Parameters:
template- instance to be copied- Returns:
- copy instance
-
copyDeep
CartDiscountValueGiftLineItem copyDeep()- Specified by:
copyDeepin interfaceCartDiscountValue
-
deepCopy
@Nullable static CartDiscountValueGiftLineItem deepCopy(@Nullable CartDiscountValueGiftLineItem template) factory method to create a deep copy of CartDiscountValueGiftLineItem- Parameters:
template- instance to be copied- Returns:
- copy instance
-
builder
builder factory method for CartDiscountValueGiftLineItem- Returns:
- builder
-
builder
create builder for CartDiscountValueGiftLineItem instance- Parameters:
template- instance with prefilled values for the builder- Returns:
- builder
-
withCartDiscountValueGiftLineItem
accessor map function- Type Parameters:
T- mapped type- Parameters:
helper- function to map the object- Returns:
- mapped value
-
typeReference
gives a TypeReference for usage with Jackson DataBind- Returns:
- TypeReference
-