Class EnhancedFulfillmentGroup
- java.lang.Object
-
- com.broadleafcommerce.promotion.offer.web.context.EnhancedFulfillmentGroup
-
- All Implemented Interfaces:
com.broadleafcommerce.promotion.offer.client.web.context.FulfillmentGroup<EnhancedFulfillmentLineItem>,Serializable
public class EnhancedFulfillmentGroup extends Object implements com.broadleafcommerce.promotion.offer.client.web.context.FulfillmentGroup<EnhancedFulfillmentLineItem>, Serializable
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected javax.money.MonetaryAmountadjustedTotal
-
Constructor Summary
Constructors Constructor Description EnhancedFulfillmentGroup()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancanApplyOffer(CandidateFulfillmentGroupOffer offer)Whether the provided offer can be applied to this group.protected booleancanEqual(Object other)booleanequals(Object o)voidfinalizeItemPrices()javax.money.MonetaryAmountfinalizeTotal()Finalize attachedadjustmentsand return adjusted price.javax.money.MonetaryAmountgetAdjustmentTotal(javax.money.CurrencyUnit currency)Calculates the sum of the fulfillment group adjustments.javax.money.MonetaryAmountgetAllFutureCreditAdjustmentValue(javax.money.CurrencyUnit currency)Gets the sum of all future credit for this fulfillment group (of item and group adjustments).List<LineItemOfferDetail>getAllLineItemOfferDetails()Map<String,Object>getAttributes()com.broadleafcommerce.promotion.offer.client.web.context.DestinationgetDestination()StringgetFaxNumber()javax.money.MonetaryAmountgetFulfillmentAdjustmentAmount(javax.money.CurrencyUnit currency)Calculates the total adjustment for this group and its items.List<EnhancedFulfillmentLineItem>getFulfillmentItems()StringgetFulfillmentOptionName()StringgetFulfillmentOptionType()List<FulfillmentGroupAdjustment>getGroupAdjustments()StringgetId()javax.money.MonetaryAmountgetItemsAdjustmentsValue(javax.money.CurrencyUnit currency)Gets the sum of the fulfillment items total adjustments.javax.money.MonetaryAmountgetMerchandiseTotal()Return the total price of all order line items in the fulfillment group.javax.money.MonetaryAmountgetPriceBeforeAdjustments()StringgetPrimaryPhone()javax.money.MonetaryAmountgetProratedFulfillmentAdjustments()Prorated fulfillment adjustments for the fulfillment group itself.StringgetSecondaryPhone()javax.money.MonetaryAmountgetTotal()Gets the total for this fulfillment group.javax.money.MonetaryAmountgetTotalBeforeAdjustments()Gets the total before adjustments for this fulfillment group.javax.money.MonetaryAmountgetTotalWithAdjustments()Calculates the total for this fulfillment group with adjustments.javax.money.MonetaryAmountgetTotalWithoutFutureCredits(javax.money.CurrencyUnit currency)Gets the total for this fulfillment group excluding future credits.inthashCode()protected booleanisNonCombinableGroupOfferApplied()voidremoveAllCandidateAdjustments()Remove all of thegroupAdjustmentsfor thisEnhancedFulfillmentGroup.voidremoveAllGroupOfferAdjustments()protected voidremoveZeroDollarAdjustments()protected voidsetAdjustedTotal()voidsetAttributes(Map<String,Object> attributes)voidsetDestination(com.broadleafcommerce.promotion.offer.client.web.context.Destination destination)voidsetFaxNumber(String faxNumber)voidsetFulfillmentItems(List<EnhancedFulfillmentLineItem> fulfillmentItems)voidsetFulfillmentOptionName(String fulfillmentOptionName)voidsetFulfillmentOptionType(String fulfillmentOptionType)voidsetGroupAdjustments(List<FulfillmentGroupAdjustment> groupAdjustments)voidsetId(String id)voidsetPriceBeforeAdjustments(javax.money.MonetaryAmount priceBeforeAdjustments)voidsetPrimaryPhone(String primaryPhone)voidsetProratedFulfillmentAdjustments(javax.money.MonetaryAmount proratedFulfillmentAdjustments)Prorated fulfillment adjustments for the fulfillment group itself.voidsetSecondaryPhone(String secondaryPhone)protected javax.money.MonetaryAmountsumOnAdjustments(javax.money.CurrencyUnit currency, Function<FulfillmentGroupAdjustment,javax.money.MonetaryAmount> mapAttribute)Sums some attribute of the adjustments of this fulfillment group.protected javax.money.MonetaryAmountsumOnAdjustments(javax.money.CurrencyUnit currency, Function<FulfillmentGroupAdjustment,javax.money.MonetaryAmount> mapAttribute, Predicate<FulfillmentGroupAdjustment> filter)Sums some attribute of the adjustments of this fulfillment group.protected javax.money.MonetaryAmountsumOnItems(javax.money.CurrencyUnit currency, Function<EnhancedFulfillmentLineItem,javax.money.MonetaryAmount> mapAttribute)Sums some attribute of the items of this fulfillment group.StringtoString()
-
-
-
Method Detail
-
getMerchandiseTotal
@Nullable public javax.money.MonetaryAmount getMerchandiseTotal()
Return the total price of all order line items in the fulfillment group.
-
getTotal
public javax.money.MonetaryAmount getTotal()
Gets the total for this fulfillment group. This method returns the adjustedTotal and sets the value if it is null. Used primarily by the rules engine to check for fulfillment offers that are only valid for certain group subtotals.
-
getTotalBeforeAdjustments
public javax.money.MonetaryAmount getTotalBeforeAdjustments()
Gets the total before adjustments for this fulfillment group. Note that this excludes individual items.
-
getAdjustmentTotal
public javax.money.MonetaryAmount getAdjustmentTotal(javax.money.CurrencyUnit currency)
Calculates the sum of the fulfillment group adjustments. Excludes future credits and item adjustments.
-
getTotalWithoutFutureCredits
public javax.money.MonetaryAmount getTotalWithoutFutureCredits(javax.money.CurrencyUnit currency)
Gets the total for this fulfillment group excluding future credits. Note that this excludes individual items.
-
getTotalWithAdjustments
public javax.money.MonetaryAmount getTotalWithAdjustments()
Calculates the total for this fulfillment group with adjustments. This includes future credit and excludes items.
-
getItemsAdjustmentsValue
public javax.money.MonetaryAmount getItemsAdjustmentsValue(javax.money.CurrencyUnit currency)
Gets the sum of the fulfillment items total adjustments. Excludes future credits.
-
getAllFutureCreditAdjustmentValue
public javax.money.MonetaryAmount getAllFutureCreditAdjustmentValue(javax.money.CurrencyUnit currency)
Gets the sum of all future credit for this fulfillment group (of item and group adjustments).
-
getFulfillmentAdjustmentAmount
public javax.money.MonetaryAmount getFulfillmentAdjustmentAmount(javax.money.CurrencyUnit currency)
Calculates the total adjustment for this group and its items. Excludes future credits.
-
canApplyOffer
public boolean canApplyOffer(CandidateFulfillmentGroupOffer offer)
Whether the provided offer can be applied to this group.- Parameters:
offer- the offer to test- Returns:
- whether the offer can be applied to this group
-
getAllLineItemOfferDetails
public List<LineItemOfferDetail> getAllLineItemOfferDetails()
-
removeAllGroupOfferAdjustments
public void removeAllGroupOfferAdjustments()
-
finalizeItemPrices
public void finalizeItemPrices()
-
finalizeTotal
public javax.money.MonetaryAmount finalizeTotal()
Finalize attachedadjustmentsand return adjusted price.- Returns:
- The final adjusted price for this
EnhancedFulfillmentGroup.
-
removeAllCandidateAdjustments
public void removeAllCandidateAdjustments()
Remove all of thegroupAdjustmentsfor thisEnhancedFulfillmentGroup.
-
removeZeroDollarAdjustments
protected void removeZeroDollarAdjustments()
-
isNonCombinableGroupOfferApplied
protected boolean isNonCombinableGroupOfferApplied()
-
setAdjustedTotal
protected void setAdjustedTotal()
-
sumOnItems
protected javax.money.MonetaryAmount sumOnItems(javax.money.CurrencyUnit currency, Function<EnhancedFulfillmentLineItem,javax.money.MonetaryAmount> mapAttribute)Sums some attribute of the items of this fulfillment group.- Parameters:
currency- the currency of the items' valuesmapAttribute- the attribute of the item to map to- Returns:
- the summed amount of the attributes for each of the fulfillment items
-
sumOnAdjustments
protected javax.money.MonetaryAmount sumOnAdjustments(javax.money.CurrencyUnit currency, Function<FulfillmentGroupAdjustment,javax.money.MonetaryAmount> mapAttribute)Sums some attribute of the adjustments of this fulfillment group.- Parameters:
currency- the currency of the adjustments' valuesmapAttribute- the attribute of the adjustment to map to- Returns:
- the summed amount of the attributes for each of the fulfillment adjustments
-
sumOnAdjustments
protected javax.money.MonetaryAmount sumOnAdjustments(javax.money.CurrencyUnit currency, Function<FulfillmentGroupAdjustment,javax.money.MonetaryAmount> mapAttribute, Predicate<FulfillmentGroupAdjustment> filter)Sums some attribute of the adjustments of this fulfillment group.- Parameters:
currency- the currency of the adjustments' valuesmapAttribute- the attribute of the adjustment to map tofilter- a filter for any of the adjustments- Returns:
- the summed amount of the attributes for each of the fulfillment adjustments
-
getId
public String getId()
- Specified by:
getIdin interfacecom.broadleafcommerce.promotion.offer.client.web.context.FulfillmentGroup<EnhancedFulfillmentLineItem>
-
getFulfillmentOptionType
public String getFulfillmentOptionType()
- Specified by:
getFulfillmentOptionTypein interfacecom.broadleafcommerce.promotion.offer.client.web.context.FulfillmentGroup<EnhancedFulfillmentLineItem>
-
getFulfillmentOptionName
public String getFulfillmentOptionName()
- Specified by:
getFulfillmentOptionNamein interfacecom.broadleafcommerce.promotion.offer.client.web.context.FulfillmentGroup<EnhancedFulfillmentLineItem>
-
getDestination
public com.broadleafcommerce.promotion.offer.client.web.context.Destination getDestination()
- Specified by:
getDestinationin interfacecom.broadleafcommerce.promotion.offer.client.web.context.FulfillmentGroup<EnhancedFulfillmentLineItem>
-
getFulfillmentItems
public List<EnhancedFulfillmentLineItem> getFulfillmentItems()
- Specified by:
getFulfillmentItemsin interfacecom.broadleafcommerce.promotion.offer.client.web.context.FulfillmentGroup<EnhancedFulfillmentLineItem>
-
getPrimaryPhone
public String getPrimaryPhone()
- Specified by:
getPrimaryPhonein interfacecom.broadleafcommerce.promotion.offer.client.web.context.FulfillmentGroup<EnhancedFulfillmentLineItem>
-
getSecondaryPhone
public String getSecondaryPhone()
- Specified by:
getSecondaryPhonein interfacecom.broadleafcommerce.promotion.offer.client.web.context.FulfillmentGroup<EnhancedFulfillmentLineItem>
-
getFaxNumber
public String getFaxNumber()
- Specified by:
getFaxNumberin interfacecom.broadleafcommerce.promotion.offer.client.web.context.FulfillmentGroup<EnhancedFulfillmentLineItem>
-
getPriceBeforeAdjustments
public javax.money.MonetaryAmount getPriceBeforeAdjustments()
- Specified by:
getPriceBeforeAdjustmentsin interfacecom.broadleafcommerce.promotion.offer.client.web.context.FulfillmentGroup<EnhancedFulfillmentLineItem>
-
getAttributes
public Map<String,Object> getAttributes()
- Specified by:
getAttributesin interfacecom.broadleafcommerce.promotion.offer.client.web.context.FulfillmentGroup<EnhancedFulfillmentLineItem>
-
getProratedFulfillmentAdjustments
public javax.money.MonetaryAmount getProratedFulfillmentAdjustments()
Prorated fulfillment adjustments for the fulfillment group itself.Fulfillment-level adjustments are prorated between the charges of the fulfullment group and those of the individual fulfullment items, the prorated fulfillment adjustments for the items are set at the item level.
-
getGroupAdjustments
public List<FulfillmentGroupAdjustment> getGroupAdjustments()
-
setId
public void setId(String id)
- Specified by:
setIdin interfacecom.broadleafcommerce.promotion.offer.client.web.context.FulfillmentGroup<EnhancedFulfillmentLineItem>
-
setFulfillmentOptionType
public void setFulfillmentOptionType(String fulfillmentOptionType)
- Specified by:
setFulfillmentOptionTypein interfacecom.broadleafcommerce.promotion.offer.client.web.context.FulfillmentGroup<EnhancedFulfillmentLineItem>
-
setFulfillmentOptionName
public void setFulfillmentOptionName(String fulfillmentOptionName)
- Specified by:
setFulfillmentOptionNamein interfacecom.broadleafcommerce.promotion.offer.client.web.context.FulfillmentGroup<EnhancedFulfillmentLineItem>
-
setDestination
public void setDestination(com.broadleafcommerce.promotion.offer.client.web.context.Destination destination)
- Specified by:
setDestinationin interfacecom.broadleafcommerce.promotion.offer.client.web.context.FulfillmentGroup<EnhancedFulfillmentLineItem>
-
setFulfillmentItems
public void setFulfillmentItems(List<EnhancedFulfillmentLineItem> fulfillmentItems)
- Specified by:
setFulfillmentItemsin interfacecom.broadleafcommerce.promotion.offer.client.web.context.FulfillmentGroup<EnhancedFulfillmentLineItem>
-
setPrimaryPhone
public void setPrimaryPhone(String primaryPhone)
- Specified by:
setPrimaryPhonein interfacecom.broadleafcommerce.promotion.offer.client.web.context.FulfillmentGroup<EnhancedFulfillmentLineItem>
-
setSecondaryPhone
public void setSecondaryPhone(String secondaryPhone)
- Specified by:
setSecondaryPhonein interfacecom.broadleafcommerce.promotion.offer.client.web.context.FulfillmentGroup<EnhancedFulfillmentLineItem>
-
setFaxNumber
public void setFaxNumber(String faxNumber)
- Specified by:
setFaxNumberin interfacecom.broadleafcommerce.promotion.offer.client.web.context.FulfillmentGroup<EnhancedFulfillmentLineItem>
-
setPriceBeforeAdjustments
public void setPriceBeforeAdjustments(javax.money.MonetaryAmount priceBeforeAdjustments)
- Specified by:
setPriceBeforeAdjustmentsin interfacecom.broadleafcommerce.promotion.offer.client.web.context.FulfillmentGroup<EnhancedFulfillmentLineItem>
-
setAttributes
public void setAttributes(Map<String,Object> attributes)
- Specified by:
setAttributesin interfacecom.broadleafcommerce.promotion.offer.client.web.context.FulfillmentGroup<EnhancedFulfillmentLineItem>
-
setProratedFulfillmentAdjustments
public void setProratedFulfillmentAdjustments(javax.money.MonetaryAmount proratedFulfillmentAdjustments)
Prorated fulfillment adjustments for the fulfillment group itself.Fulfillment-level adjustments are prorated between the charges of the fulfullment group and those of the individual fulfullment items, the prorated fulfillment adjustments for the items are set at the item level.
-
setGroupAdjustments
public void setGroupAdjustments(List<FulfillmentGroupAdjustment> groupAdjustments)
-
canEqual
protected boolean canEqual(Object other)
-
-