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:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanadjustmentMatchingServiceLevel(FulfillmentGroupAdjustment adjustment, String offerServiceLevel) booleanWhether the provided offer can be applied to this group.protected booleanbooleanvoidjavax.money.MonetaryAmountFinalize 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).com.broadleafcommerce.promotion.offer.client.web.context.Destinationjavax.money.MonetaryAmountgetFulfillmentAdjustmentAmount(javax.money.CurrencyUnit currency) Calculates the total adjustment for this group and its items.javax.money.MonetaryAmountCalculates the total for this fulfillment group with adjustments.javax.money.MonetaryAmountgetGroupPriceWithAdjustmentsForServiceLevel(String serviceLevel) getId()javax.money.MonetaryAmountgetItemsAdjustmentsValue(javax.money.CurrencyUnit currency) Gets the sum of the fulfillment items total adjustments.javax.money.MonetaryAmountReturn the total price of all order line items in the fulfillment group.javax.money.MonetaryAmountReturn the sum of values by service level if populated; otherwise, return the value set directlyA map of fulfillment prices before any adjustments by shipping level.javax.money.MonetaryAmountProrated fulfillment adjustments for the fulfillment group itself.javax.money.MonetaryAmountgetTotal()Gets the total for this fulfillment group.javax.money.MonetaryAmountGets the total before adjustments for this fulfillment group.javax.money.MonetaryAmountgetTotalBeforeAdjustments(String serviceLevel) Gets the total before adjustments for this fulfillment group and serviceLevel.javax.money.MonetaryAmountCalculates 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 booleanprotected booleanitemMatchingServiceLevel(EnhancedFulfillmentLineItem item, String offerServiceLevel) voidRemove all of thegroupAdjustmentsfor thisEnhancedFulfillmentGroup.voidprotected voidprotected voidvoidsetAttributes(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) voidvoidsetPriceBeforeAdjustments(javax.money.MonetaryAmount priceBeforeAdjustments) voidsetPriceBeforeAdjustmentsByServiceLevel(Map<String, javax.money.MonetaryAmount> priceBeforeAdjustmentsByServiceLevel) 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.toString()
-
Field Details
-
adjustedTotal
protected javax.money.MonetaryAmount adjustedTotal
-
-
Constructor Details
-
EnhancedFulfillmentGroup
public EnhancedFulfillmentGroup()
-
-
Method Details
-
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 includes individual items. -
getTotalBeforeAdjustments
Gets the total before adjustments for this fulfillment group and serviceLevel. Note that this includes 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 includes individual items. -
getTotalWithAdjustments
public javax.money.MonetaryAmount getTotalWithAdjustments()Calculates the total for this fulfillment group with adjustments. This includes future credit and items. -
getGroupPriceWithAdjustments
public javax.money.MonetaryAmount getGroupPriceWithAdjustments()Calculates the total for this fulfillment group with adjustments. This includes future credit and excludes items. -
getGroupPriceWithAdjustmentsForServiceLevel
public javax.money.MonetaryAmount getGroupPriceWithAdjustmentsForServiceLevel(@NonNull String serviceLevel) -
itemMatchingServiceLevel
protected boolean itemMatchingServiceLevel(EnhancedFulfillmentLineItem item, String offerServiceLevel) -
adjustmentMatchingServiceLevel
protected boolean adjustmentMatchingServiceLevel(FulfillmentGroupAdjustment adjustment, String offerServiceLevel) -
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
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
-
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
-
getPriceBeforeAdjustments
public javax.money.MonetaryAmount getPriceBeforeAdjustments()Return the sum of values by service level if populated; otherwise, return the value set directly- Specified by:
getPriceBeforeAdjustmentsin interfacecom.broadleafcommerce.promotion.offer.client.web.context.FulfillmentGroup<EnhancedFulfillmentLineItem>- Returns:
- MonetaryAmount for the total fulfillment price or null if unset
-
getPriceBeforeAdjustmentsByServiceLevel
A map of fulfillment prices before any adjustments by shipping level. The sum of the elements of this MAP must match the value ofgetPriceBeforeAdjustments(). By default adds the deprecatedgetFulfillmentOptionName()as a map key and thegetPriceBeforeAdjustments()as the value.- Specified by:
getPriceBeforeAdjustmentsByServiceLevelin interfacecom.broadleafcommerce.promotion.offer.client.web.context.FulfillmentGroup<EnhancedFulfillmentLineItem>
-
getId
- Specified by:
getIdin interfacecom.broadleafcommerce.promotion.offer.client.web.context.FulfillmentGroup<EnhancedFulfillmentLineItem>
-
getFulfillmentOptionType
- Specified by:
getFulfillmentOptionTypein interfacecom.broadleafcommerce.promotion.offer.client.web.context.FulfillmentGroup<EnhancedFulfillmentLineItem>
-
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
- Specified by:
getFulfillmentItemsin interfacecom.broadleafcommerce.promotion.offer.client.web.context.FulfillmentGroup<EnhancedFulfillmentLineItem>
-
getPrimaryPhone
- Specified by:
getPrimaryPhonein interfacecom.broadleafcommerce.promotion.offer.client.web.context.FulfillmentGroup<EnhancedFulfillmentLineItem>
-
getSecondaryPhone
- Specified by:
getSecondaryPhonein interfacecom.broadleafcommerce.promotion.offer.client.web.context.FulfillmentGroup<EnhancedFulfillmentLineItem>
-
getFaxNumber
- Specified by:
getFaxNumberin interfacecom.broadleafcommerce.promotion.offer.client.web.context.FulfillmentGroup<EnhancedFulfillmentLineItem>
-
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
-
setId
- Specified by:
setIdin interfacecom.broadleafcommerce.promotion.offer.client.web.context.FulfillmentGroup<EnhancedFulfillmentLineItem>
-
setFulfillmentOptionType
- Specified by:
setFulfillmentOptionTypein interfacecom.broadleafcommerce.promotion.offer.client.web.context.FulfillmentGroup<EnhancedFulfillmentLineItem>
-
setFulfillmentOptionName
- 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
- Specified by:
setFulfillmentItemsin interfacecom.broadleafcommerce.promotion.offer.client.web.context.FulfillmentGroup<EnhancedFulfillmentLineItem>
-
setPrimaryPhone
- Specified by:
setPrimaryPhonein interfacecom.broadleafcommerce.promotion.offer.client.web.context.FulfillmentGroup<EnhancedFulfillmentLineItem>
-
setSecondaryPhone
- Specified by:
setSecondaryPhonein interfacecom.broadleafcommerce.promotion.offer.client.web.context.FulfillmentGroup<EnhancedFulfillmentLineItem>
-
setFaxNumber
- 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>
-
setPriceBeforeAdjustmentsByServiceLevel
-
setAttributes
- 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
-
toString
-
equals
-
canEqual
-
hashCode
public int hashCode()
-