Class CartPricing
java.lang.Object
com.broadleafcommerce.cart.client.domain.CartPricing
- All Implemented Interfaces:
com.broadleafcommerce.money.CurrencyConsumer
,Serializable
,javax.money.CurrencySupplier
public class CartPricing
extends Object
implements Serializable, javax.money.CurrencySupplier, com.broadleafcommerce.money.CurrencyConsumer
Pricing information for a
Cart
.- Author:
- Chad Harchar (charchar)
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
boolean
javax.money.MonetaryAmount
javax.money.CurrencyUnit
The currency unit used for the pricing of thisCart
.javax.money.MonetaryAmount
The total fees of thisCart
.javax.money.MonetaryAmount
The total fulfillment price of thisCart
, including adjustments.javax.money.MonetaryAmount
The amount of taxes that are included in the subtotal (VAT).javax.money.MonetaryAmount
The subtotal price of thisCart
.Indicates if any taxes are included in the subtotal.javax.money.MonetaryAmount
getTotal()
The total price of thisCart
.javax.money.MonetaryAmount
The total tax amount for thisCart
.int
hashCode()
void
setAdjustmentsTotal
(javax.money.MonetaryAmount adjustmentsTotal) void
setCurrency
(javax.money.CurrencyUnit currency) The currency unit used for the pricing of thisCart
.void
setFeesTotal
(javax.money.MonetaryAmount feesTotal) The total fees of thisCart
.void
setFulfillmentTotal
(javax.money.MonetaryAmount fulfillmentTotal) The total fulfillment price of thisCart
, including adjustments.void
setIncludedTaxAmount
(javax.money.MonetaryAmount includedTaxAmount) The amount of taxes that are included in the subtotal (VAT).void
setSubtotal
(javax.money.MonetaryAmount subtotal) The subtotal price of thisCart
.void
setTaxIncludedType
(String taxIncludedType) Indicates if any taxes are included in the subtotal.void
setTotal
(javax.money.MonetaryAmount total) The total price of thisCart
.void
setTotalTax
(javax.money.MonetaryAmount totalTax) The total tax amount for thisCart
.toString()
-
Constructor Details
-
CartPricing
public CartPricing()
-
-
Method Details
-
getTaxIncludedType
Indicates if any taxes are included in the subtotal. Getter returns default value for backward-compatability- Returns:
- The
TaxIncludedType
that indicates if any taxes are included in the subtotal. Returns "NO" by default. - See Also:
-
getIncludedTaxAmount
public javax.money.MonetaryAmount getIncludedTaxAmount()The amount of taxes that are included in the subtotal (VAT). Getter returns default value for backward-compatability- Returns:
- The amount of taxes that are included in the subtotal (VAT).
-
getCurrency
public javax.money.CurrencyUnit getCurrency()The currency unit used for the pricing of thisCart
.- Specified by:
getCurrency
in interfacejavax.money.CurrencySupplier
- Returns:
- The currency unit used for the pricing of this
Cart
.
-
getTotalTax
public javax.money.MonetaryAmount getTotalTax()The total tax amount for thisCart
.- Returns:
- The total tax amount for this
Cart
.
-
getFulfillmentTotal
public javax.money.MonetaryAmount getFulfillmentTotal()The total fulfillment price of thisCart
, including adjustments.- Returns:
- The total fulfillment price of this
Cart
, including adjustments.
-
getSubtotal
public javax.money.MonetaryAmount getSubtotal()The subtotal price of thisCart
. Typically calculated from summing the individual totals fromCart.getCartItems()
.- Returns:
- The subtotal price of this
Cart
.
-
getAdjustmentsTotal
public javax.money.MonetaryAmount getAdjustmentsTotal()The total adjustment price for alladjustments
of aCart
and itsCart.getCartItems()
. This should not include fulfillment adjustments since those are already included infulfillmentTotal
.- Returns:
- The total adjustment price for all
adjustments
of aCart
.
-
getTotal
public javax.money.MonetaryAmount getTotal()The total price of thisCart
. Typically calculated fromgetSubtotal()
-getAdjustmentsTotal()
+getTotalTax()
+getFulfillmentTotal()
.- Returns:
- The total price of this
Cart
.
-
getFeesTotal
public javax.money.MonetaryAmount getFeesTotal()The total fees of thisCart
. This would include the sum of allCartItem.getSubtotalWithDependentItems()
for items of typeCartItem.getType()
ofDefaultCartItemTypes.isExtraFee(String)
.- Returns:
- The total fees of this
Cart
.
-
setCurrency
public void setCurrency(javax.money.CurrencyUnit currency) The currency unit used for the pricing of thisCart
.- Specified by:
setCurrency
in interfacecom.broadleafcommerce.money.CurrencyConsumer
- Parameters:
currency
- The currency unit used for the pricing of thisCart
.
-
setTotalTax
public void setTotalTax(javax.money.MonetaryAmount totalTax) The total tax amount for thisCart
.- Parameters:
totalTax
- The total tax amount for thisCart
.
-
setFulfillmentTotal
public void setFulfillmentTotal(javax.money.MonetaryAmount fulfillmentTotal) The total fulfillment price of thisCart
, including adjustments.- Parameters:
totalFulfillmentPrice
- The total fulfillment price of thisCart
, including adjustments.
-
setSubtotal
public void setSubtotal(javax.money.MonetaryAmount subtotal) The subtotal price of thisCart
. Typically calculated from summing the individual totals fromCart.getCartItems()
.- Parameters:
subtotal
- The subtotal price of thisCart
.
-
setAdjustmentsTotal
public void setAdjustmentsTotal(javax.money.MonetaryAmount adjustmentsTotal) The total adjustment price for alladjustments
of aCart
and itsCart.getCartItems()
. This should not include fulfillment adjustments since those are already included infulfillmentTotal
.- Parameters:
adjustmentsTotal
- The total adjustment price for alladjustments
of aCart
.
-
setTotal
public void setTotal(javax.money.MonetaryAmount total) The total price of thisCart
. Typically calculated fromgetSubtotal()
-getAdjustmentsTotal()
+getTotalTax()
+getFulfillmentTotal()
.- Parameters:
total
- The total price of thisCart
.
-
setFeesTotal
public void setFeesTotal(javax.money.MonetaryAmount feesTotal) The total fees of thisCart
. This would include the sum of allCartItem.getSubtotalWithDependentItems()
for items of typeCartItem.getType()
ofDefaultCartItemTypes.isExtraFee(String)
.- Parameters:
total
- The total fees of thisCart
.
-
setTaxIncludedType
Indicates if any taxes are included in the subtotal.- See Also:
-
setIncludedTaxAmount
public void setIncludedTaxAmount(javax.money.MonetaryAmount includedTaxAmount) The amount of taxes that are included in the subtotal (VAT). -
equals
-
canEqual
-
hashCode
public int hashCode() -
toString
-