Class ItemChoice
java.lang.Object
com.broadleafcommerce.cartoperation.domain.ItemChoice
- All Implemented Interfaces:
Serializable
Configuration state for
ProductOptionType.ITEM_CHOICE.- Author:
- Chad Harchar (charchar)
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddAttribute(String name, Object value) Takes in any additional attributes passed in the request not matching any defined properties.protected booleanbooleancom.broadleafcommerce.cart.client.domain.AdditionalItemPricingReturn any additional attributes passed in the request not matching any defined properties.Map holding any additional attributes passed in the request not matching any defined properties.TheCategorywhich the add-on will be chosen from by the customer if theselectionisItemChoiceTargetType.CATEGORY.The key to use to relate to thisItemChoicewhen configuring cart items.The maximum amount of this item that a customer can purchase at a time.The minimum amount of the item that a customer must purchase.javax.money.MonetaryAmountThe number of days after which a quantity decrease is not allowed until the window re-opens at the next billing cycle.The number of days after which an item can't be removed from the subscription, until the window re-opens at the next billing cycle.Describes restrictions placed on the customer's ability to select items from the targeted set.If theselectionTypeisItemChoiceTargetType.SPECIFIC_PRODUCTSorItemChoiceTargetType.SPECIFIC_VARIANTSthis holds the manually-curated options that the customer can choose from.Identifies the type of items that a customer can choose from, whether specific products, specific variants, or products from a specific category.inthashCode()booleanWhether the customer is allowed to add an optional item after initial purchase.booleanWhether edit is allowed after initial purchase.booleanWhether quantity can be edited after initial purchase.booleanWhether the customer is allowed to remove an optional item after initial purchase.booleanDictates whether or not discounts are allowed to be applied to this add-on.booleanWhether this has post purchase edit rules.booleanWhether this is a sub-item on the main subscription or a separate item.booleanWhether this addon is a subscription addon.voidsetAdditionalItemPricing(com.broadleafcommerce.cart.client.domain.AdditionalItemPricing additionalItemPricing) voidsetAllowAddAfterInitialPurchase(boolean allowAddAfterInitialPurchase) Whether the customer is allowed to add an optional item after initial purchase.voidsetAllowEditAfterInitialPurchase(boolean allowEditAfterInitialPurchase) Whether edit is allowed after initial purchase.voidsetAllowQtyEditAfterInitialPurchase(boolean allowQtyEditAfterInitialPurchase) Whether quantity can be edited after initial purchase.voidsetAllowRemoveAfterInitialPurchase(boolean allowRemoveAfterInitialPurchase) Whether the customer is allowed to remove an optional item after initial purchase.voidsetAttributes(Map<String, Object> attributes) Map holding any additional attributes passed in the request not matching any defined properties.voidsetCategory(Category category) TheCategorywhich the add-on will be chosen from by the customer if theselectionisItemChoiceTargetType.CATEGORY.voidsetChoiceKey(String choiceKey) The key to use to relate to thisItemChoicewhen configuring cart items.voidsetDiscountAllowed(boolean discountAllowed) Dictates whether or not discounts are allowed to be applied to this add-on.voidsetHasPostPurchaseEditRules(boolean hasPostPurchaseEditRules) Whether this has post purchase edit rules.voidsetMaximumQuantity(Integer maximumQuantity) The maximum amount of this item that a customer can purchase at a time.voidsetMinimumQuantity(Integer minimumQuantity) The minimum amount of the item that a customer must purchase.voidsetOverridePrice(javax.money.MonetaryAmount overridePrice) voidsetPricingKey(String pricingKey) voidsetPricingTargetType(String pricingTargetType) voidsetRestrictQtyDecreaseAfterDays(Integer restrictQtyDecreaseAfterDays) The number of days after which a quantity decrease is not allowed until the window re-opens at the next billing cycle.voidsetRestrictRemovalAfterDays(Integer restrictRemovalAfterDays) The number of days after which an item can't be removed from the subscription, until the window re-opens at the next billing cycle.voidsetSelectionType(String selectionType) Describes restrictions placed on the customer's ability to select items from the targeted set.voidsetSeparateFromPrimaryItem(boolean isSeparateFromPrimaryItem) Whether this is a sub-item on the main subscription or a separate item.voidsetSpecificChoices(List<SpecificItemChoice> specificChoices) If theselectionTypeisItemChoiceTargetType.SPECIFIC_PRODUCTSorItemChoiceTargetType.SPECIFIC_VARIANTSthis holds the manually-curated options that the customer can choose from.voidsetSpecificItemChoice(SpecificItemChoice specificItemChoice) voidsetSubscription(boolean isSubscription) Whether this addon is a subscription addon.voidsetTargetType(String targetType) Identifies the type of items that a customer can choose from, whether specific products, specific variants, or products from a specific category.toString()
-
Constructor Details
-
ItemChoice
public ItemChoice()
-
-
Method Details
-
addAttribute
Takes in any additional attributes passed in the request not matching any defined properties.- Parameters:
name- Name of the additional attributevalue- Value of the additional attribute
-
getAttribute
Return any additional attributes passed in the request not matching any defined properties.- Returns:
- any additional attributes passed in the request not matching any defined properties.
-
getChoiceKey
The key to use to relate to thisItemChoicewhen configuring cart items.- Returns:
- The key to use to relate to this
ItemChoicewhen configuring cart items.
-
getTargetType
Identifies the type of items that a customer can choose from, whether specific products, specific variants, or products from a specific category.- Returns:
- the
ItemChoiceTargetTypeof this add-on - See Also:
-
getSelectionType
Describes restrictions placed on the customer's ability to select items from the targeted set. Generally, this is a restriction on how many choices can be selected for a single add-to-cart request and, potentially, how quantity is distributed among multiple selected choices.- Returns:
- the
ItemChoiceSelectionTypeof this item choice - See Also:
-
getMaximumQuantity
The maximum amount of this item that a customer can purchase at a time. If null, this would allow a customer to specify their own quantity for how many of these items they can add to the cart.- Returns:
- the maximum quantity of the add-on's target product(s) that can be added
-
getMinimumQuantity
The minimum amount of the item that a customer must purchase. The minimum and maximum should never be the same as this domain would be better represented as anIncludedProduct.- Returns:
- the minimum quantity of the add-on's target product(s)
-
isDiscountAllowed
public boolean isDiscountAllowed()Dictates whether or not discounts are allowed to be applied to this add-on.- Returns:
- true if discounts are allowed to be applied to this add-on, false otherwise
-
getAdditionalItemPricing
public com.broadleafcommerce.cart.client.domain.AdditionalItemPricing getAdditionalItemPricing() -
getCategory
TheCategorywhich the add-on will be chosen from by the customer if theselectionisItemChoiceTargetType.CATEGORY.- Returns:
- the category from which the add-on will be chosen from or {@link null} if
getSelectionType()is notItemChoiceTargetType.CATEGORY
-
getSpecificChoices
If theselectionTypeisItemChoiceTargetType.SPECIFIC_PRODUCTSorItemChoiceTargetType.SPECIFIC_VARIANTSthis holds the manually-curated options that the customer can choose from. This also allows for specific override pricing on an item-by-item basis- Returns:
- the explicit choices for
ItemChoiceTargetType.SPECIFIC_PRODUCTSorItemChoiceTargetType.SPECIFIC_VARIANTSvalue of theselectionType
-
getSpecificItemChoice
-
isSubscription
public boolean isSubscription()Whether this addon is a subscription addon.- Since:
- Cart Operation Service 2.3.0, Release Train 2.3.0
-
isHasPostPurchaseEditRules
public boolean isHasPostPurchaseEditRules()Whether this has post purchase edit rules.- Since:
- Cart Operation Service 2.3.0, Release Train 2.3.0
-
isAllowEditAfterInitialPurchase
public boolean isAllowEditAfterInitialPurchase()Whether edit is allowed after initial purchase.- Since:
- Cart Operation Service 2.3.0, Release Train 2.3.0
-
isAllowQtyEditAfterInitialPurchase
public boolean isAllowQtyEditAfterInitialPurchase()Whether quantity can be edited after initial purchase.- Since:
- Cart Operation Service 2.3.0, Release Train 2.3.0
-
isAllowAddAfterInitialPurchase
public boolean isAllowAddAfterInitialPurchase()Whether the customer is allowed to add an optional item after initial purchase.- Since:
- Cart Operation Service 2.3.0, Release Train 2.3.0
-
isAllowRemoveAfterInitialPurchase
public boolean isAllowRemoveAfterInitialPurchase()Whether the customer is allowed to remove an optional item after initial purchase.- Since:
- Cart Operation Service 2.3.0, Release Train 2.3.0
-
getRestrictQtyDecreaseAfterDays
The number of days after which a quantity decrease is not allowed until the window re-opens at the next billing cycle.nullmeans no restriction.- Since:
- Cart Operation Service 2.3.0, Release Train 2.3.0
-
getRestrictRemovalAfterDays
The number of days after which an item can't be removed from the subscription, until the window re-opens at the next billing cycle.nullmeans no restriction.- Since:
- Cart Operation Service 2.3.0, Release Train 2.3.0
-
isSeparateFromPrimaryItem
public boolean isSeparateFromPrimaryItem()Whether this is a sub-item on the main subscription or a separate item.- Since:
- Cart Operation Service 2.3.0, Release Train 2.3.0
-
getAttributes
Map holding any additional attributes passed in the request not matching any defined properties. -
setChoiceKey
The key to use to relate to thisItemChoicewhen configuring cart items.- Parameters:
choiceKey- The key to use to relate to thisItemChoicewhen configuring cart items.
-
setTargetType
Identifies the type of items that a customer can choose from, whether specific products, specific variants, or products from a specific category.- Parameters:
type- theItemChoiceTargetTypeof this add-on- See Also:
-
setSelectionType
Describes restrictions placed on the customer's ability to select items from the targeted set. Generally, this is a restriction on how many choices can be selected for a single add-to-cart request and, potentially, how quantity is distributed among multiple selected choices.- Parameters:
selectionType- theItemChoiceSelectionTypeof this item choice- See Also:
-
setMaximumQuantity
The maximum amount of this item that a customer can purchase at a time. If null, this would allow a customer to specify their own quantity for how many of these items they can add to the cart.- Parameters:
maximumQuantity- the maximum quantity of the add-on's target product(s) that can be added
-
setMinimumQuantity
The minimum amount of the item that a customer must purchase. The minimum and maximum should never be the same as this domain would be better represented as anIncludedProduct.- Parameters:
minimumQuantity- the minimum quantity of the add-on's target product(s)
-
setDiscountAllowed
public void setDiscountAllowed(boolean discountAllowed) Dictates whether or not discounts are allowed to be applied to this add-on.- Parameters:
discountAllowed- true if discounts are allowed to be applied to this add-on, false otherwise
-
setAdditionalItemPricing
public void setAdditionalItemPricing(com.broadleafcommerce.cart.client.domain.AdditionalItemPricing additionalItemPricing) -
setCategory
TheCategorywhich the add-on will be chosen from by the customer if theselectionisItemChoiceTargetType.CATEGORY.- Parameters:
category- the category from which the add-on will be chosen from
-
setSpecificChoices
If theselectionTypeisItemChoiceTargetType.SPECIFIC_PRODUCTSorItemChoiceTargetType.SPECIFIC_VARIANTSthis holds the manually-curated options that the customer can choose from. This also allows for specific override pricing on an item-by-item basis- Parameters:
specificChoices- manually-curated options for the user to choose from for this addon
-
setSpecificItemChoice
-
setSubscription
public void setSubscription(boolean isSubscription) Whether this addon is a subscription addon.- Since:
- Cart Operation Service 2.3.0, Release Train 2.3.0
-
setHasPostPurchaseEditRules
public void setHasPostPurchaseEditRules(boolean hasPostPurchaseEditRules) Whether this has post purchase edit rules.- Since:
- Cart Operation Service 2.3.0, Release Train 2.3.0
-
setAllowEditAfterInitialPurchase
public void setAllowEditAfterInitialPurchase(boolean allowEditAfterInitialPurchase) Whether edit is allowed after initial purchase.- Since:
- Cart Operation Service 2.3.0, Release Train 2.3.0
-
setAllowQtyEditAfterInitialPurchase
public void setAllowQtyEditAfterInitialPurchase(boolean allowQtyEditAfterInitialPurchase) Whether quantity can be edited after initial purchase.- Since:
- Cart Operation Service 2.3.0, Release Train 2.3.0
-
setAllowAddAfterInitialPurchase
public void setAllowAddAfterInitialPurchase(boolean allowAddAfterInitialPurchase) Whether the customer is allowed to add an optional item after initial purchase.- Since:
- Cart Operation Service 2.3.0, Release Train 2.3.0
-
setAllowRemoveAfterInitialPurchase
public void setAllowRemoveAfterInitialPurchase(boolean allowRemoveAfterInitialPurchase) Whether the customer is allowed to remove an optional item after initial purchase.- Since:
- Cart Operation Service 2.3.0, Release Train 2.3.0
-
setRestrictQtyDecreaseAfterDays
The number of days after which a quantity decrease is not allowed until the window re-opens at the next billing cycle.nullmeans no restriction.- Since:
- Cart Operation Service 2.3.0, Release Train 2.3.0
-
setRestrictRemovalAfterDays
The number of days after which an item can't be removed from the subscription, until the window re-opens at the next billing cycle.nullmeans no restriction.- Since:
- Cart Operation Service 2.3.0, Release Train 2.3.0
-
setSeparateFromPrimaryItem
public void setSeparateFromPrimaryItem(boolean isSeparateFromPrimaryItem) Whether this is a sub-item on the main subscription or a separate item.- Since:
- Cart Operation Service 2.3.0, Release Train 2.3.0
-
setAttributes
Map holding any additional attributes passed in the request not matching any defined properties. -
equals
-
canEqual
-
hashCode
public int hashCode() -
toString
-
getOverridePrice
public javax.money.MonetaryAmount getOverridePrice() -
getPricingKey
-
getPricingTargetType
-
setOverridePrice
public void setOverridePrice(javax.money.MonetaryAmount overridePrice) -
setPricingKey
-
setPricingTargetType
-