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
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
adjustmentMatchingServiceLevel
(FulfillmentGroupAdjustment adjustment, String offerServiceLevel) boolean
Whether the provided offer can be applied to this group.protected boolean
boolean
void
javax.money.MonetaryAmount
Finalize attachedadjustments
and return adjusted price.javax.money.MonetaryAmount
getAdjustmentTotal
(javax.money.CurrencyUnit currency) Calculates the sum of the fulfillment group adjustments.javax.money.MonetaryAmount
getAllFutureCreditAdjustmentValue
(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.Destination
javax.money.MonetaryAmount
getFulfillmentAdjustmentAmount
(javax.money.CurrencyUnit currency) Calculates the total adjustment for this group and its items.javax.money.MonetaryAmount
Calculates the total for this fulfillment group with adjustments.javax.money.MonetaryAmount
getGroupPriceWithAdjustmentsForServiceLevel
(String serviceLevel) getId()
javax.money.MonetaryAmount
getItemsAdjustmentsValue
(javax.money.CurrencyUnit currency) Gets the sum of the fulfillment items total adjustments.javax.money.MonetaryAmount
Return the total price of all order line items in the fulfillment group.javax.money.MonetaryAmount
Return 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.MonetaryAmount
Prorated fulfillment adjustments for the fulfillment group itself.javax.money.MonetaryAmount
getTotal()
Gets the total for this fulfillment group.javax.money.MonetaryAmount
Gets the total before adjustments for this fulfillment group.javax.money.MonetaryAmount
getTotalBeforeAdjustments
(String serviceLevel) Gets the total before adjustments for this fulfillment group and serviceLevel.javax.money.MonetaryAmount
Calculates the total for this fulfillment group with adjustments.javax.money.MonetaryAmount
getTotalWithoutFutureCredits
(javax.money.CurrencyUnit currency) Gets the total for this fulfillment group excluding future credits.int
hashCode()
protected boolean
protected boolean
itemMatchingServiceLevel
(EnhancedFulfillmentLineItem item, String offerServiceLevel) void
Remove all of thegroupAdjustments
for thisEnhancedFulfillmentGroup
.void
protected void
protected void
void
setAttributes
(Map<String, Object> attributes) void
setDestination
(com.broadleafcommerce.promotion.offer.client.web.context.Destination destination) void
setFaxNumber
(String faxNumber) void
setFulfillmentItems
(List<EnhancedFulfillmentLineItem> fulfillmentItems) void
setFulfillmentOptionName
(String fulfillmentOptionName) void
setFulfillmentOptionType
(String fulfillmentOptionType) void
setGroupAdjustments
(List<FulfillmentGroupAdjustment> groupAdjustments) void
void
setPriceBeforeAdjustments
(javax.money.MonetaryAmount priceBeforeAdjustments) void
setPriceBeforeAdjustmentsByServiceLevel
(Map<String, javax.money.MonetaryAmount> priceBeforeAdjustmentsByServiceLevel) void
setPrimaryPhone
(String primaryPhone) void
setProratedFulfillmentAdjustments
(javax.money.MonetaryAmount proratedFulfillmentAdjustments) Prorated fulfillment adjustments for the fulfillment group itself.void
setSecondaryPhone
(String secondaryPhone) 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.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.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.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 attachedadjustments
and return adjusted price.- Returns:
- The final adjusted price for this
EnhancedFulfillmentGroup
.
-
removeAllCandidateAdjustments
public void removeAllCandidateAdjustments()Remove all of thegroupAdjustments
for 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:
getPriceBeforeAdjustments
in 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:
getPriceBeforeAdjustmentsByServiceLevel
in interfacecom.broadleafcommerce.promotion.offer.client.web.context.FulfillmentGroup<EnhancedFulfillmentLineItem>
-
getId
- Specified by:
getId
in interfacecom.broadleafcommerce.promotion.offer.client.web.context.FulfillmentGroup<EnhancedFulfillmentLineItem>
-
getFulfillmentOptionType
- Specified by:
getFulfillmentOptionType
in interfacecom.broadleafcommerce.promotion.offer.client.web.context.FulfillmentGroup<EnhancedFulfillmentLineItem>
-
getFulfillmentOptionName
- Specified by:
getFulfillmentOptionName
in interfacecom.broadleafcommerce.promotion.offer.client.web.context.FulfillmentGroup<EnhancedFulfillmentLineItem>
-
getDestination
public com.broadleafcommerce.promotion.offer.client.web.context.Destination getDestination()- Specified by:
getDestination
in interfacecom.broadleafcommerce.promotion.offer.client.web.context.FulfillmentGroup<EnhancedFulfillmentLineItem>
-
getFulfillmentItems
- Specified by:
getFulfillmentItems
in interfacecom.broadleafcommerce.promotion.offer.client.web.context.FulfillmentGroup<EnhancedFulfillmentLineItem>
-
getPrimaryPhone
- Specified by:
getPrimaryPhone
in interfacecom.broadleafcommerce.promotion.offer.client.web.context.FulfillmentGroup<EnhancedFulfillmentLineItem>
-
getSecondaryPhone
- Specified by:
getSecondaryPhone
in interfacecom.broadleafcommerce.promotion.offer.client.web.context.FulfillmentGroup<EnhancedFulfillmentLineItem>
-
getFaxNumber
- Specified by:
getFaxNumber
in interfacecom.broadleafcommerce.promotion.offer.client.web.context.FulfillmentGroup<EnhancedFulfillmentLineItem>
-
getAttributes
- Specified by:
getAttributes
in 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:
setId
in interfacecom.broadleafcommerce.promotion.offer.client.web.context.FulfillmentGroup<EnhancedFulfillmentLineItem>
-
setFulfillmentOptionType
- Specified by:
setFulfillmentOptionType
in interfacecom.broadleafcommerce.promotion.offer.client.web.context.FulfillmentGroup<EnhancedFulfillmentLineItem>
-
setFulfillmentOptionName
- Specified by:
setFulfillmentOptionName
in interfacecom.broadleafcommerce.promotion.offer.client.web.context.FulfillmentGroup<EnhancedFulfillmentLineItem>
-
setDestination
public void setDestination(com.broadleafcommerce.promotion.offer.client.web.context.Destination destination) - Specified by:
setDestination
in interfacecom.broadleafcommerce.promotion.offer.client.web.context.FulfillmentGroup<EnhancedFulfillmentLineItem>
-
setFulfillmentItems
- Specified by:
setFulfillmentItems
in interfacecom.broadleafcommerce.promotion.offer.client.web.context.FulfillmentGroup<EnhancedFulfillmentLineItem>
-
setPrimaryPhone
- Specified by:
setPrimaryPhone
in interfacecom.broadleafcommerce.promotion.offer.client.web.context.FulfillmentGroup<EnhancedFulfillmentLineItem>
-
setSecondaryPhone
- Specified by:
setSecondaryPhone
in interfacecom.broadleafcommerce.promotion.offer.client.web.context.FulfillmentGroup<EnhancedFulfillmentLineItem>
-
setFaxNumber
- Specified by:
setFaxNumber
in interfacecom.broadleafcommerce.promotion.offer.client.web.context.FulfillmentGroup<EnhancedFulfillmentLineItem>
-
setPriceBeforeAdjustments
public void setPriceBeforeAdjustments(javax.money.MonetaryAmount priceBeforeAdjustments) - Specified by:
setPriceBeforeAdjustments
in interfacecom.broadleafcommerce.promotion.offer.client.web.context.FulfillmentGroup<EnhancedFulfillmentLineItem>
-
setPriceBeforeAdjustmentsByServiceLevel
-
setAttributes
- Specified by:
setAttributes
in 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()
-