Class FulfillmentPricingItem

java.lang.Object
com.broadleafcommerce.shipping.domain.FulfillmentPricingItem
All Implemented Interfaces:
Serializable

public class FulfillmentPricingItem extends Object implements Serializable
An item to be fulfillment priced.
Author:
Chad Harchar (charchar)
See Also:
  • Constructor Details

    • FulfillmentPricingItem

      public FulfillmentPricingItem()
  • Method Details

    • getTotalWeight

      public BigDecimal getTotalWeight()
      Returns:
      The total weight of this item being paid for by a customer.
    • getSubtotal

      @Deprecated public javax.money.MonetaryAmount getSubtotal()
      Deprecated.
      Returns:
      The subtotal of this item being paid for by a customer.
    • getItemId

      public String getItemId()
      The unique identifier for this line item.
      Returns:
      The unique identifier for this line item.
    • getSkuCode

      public String getSkuCode()
      The sku code for this item.
      Returns:
      The sku code for this item.
    • getTaxCode

      public String getTaxCode()
      The tax code for this item.
      Returns:
      The tax code for this item.
    • getDescription

      public String getDescription()
      The description for this item.
      Returns:
      The description for this item.
    • getQuantity

      public int getQuantity()
      The number of units that make up this item.

      An item can represent multiple units of the same product or variant such as 3 large, red t-shirts. The quantity would thus be 3.

      Returns:
      The number of units that make up this item.
    • getUnitPrice

      @Deprecated public javax.money.MonetaryAmount getUnitPrice()
      Deprecated.
      this is deprecated as the accurate calculation of this value is not feasible for the bundle item, see getMerchandiseTotalAmount()
      The individual unit price for this item.

      An item can represent multiple units of the same product or variant such as 3 large, red t-shirts. The unitPrice would be the price of just 1 of those shirts whereas the subtotal would be the combined price of all 3.

      Returns:
      The individual unit price for this item.
    • getMerchandiseTotalAmount

      public javax.money.MonetaryAmount getMerchandiseTotalAmount()
      The total price of all the items. This value is used instead of multiplying the unitPrice by quantity since calculating an accurate unit price from the fulfillment isn't feasible for the bundle products when the bundle's price is prorated to the bundle items.

      For example, the price of the bundle is $30, the first item has quantity 2 and price $9.99, the second has quantity 1 and price $15. The prorated price of the first 2 items will be $17.13 and the second $12.87. In this case if calculate $17.13 / 2 = $8,565, rounded value will be $8,57 and then $8,57 * 2 = $17,14 that is not the same as $17.13.

      Returns:
      the total price for this items.
    • getUnitWeight

      public BigDecimal getUnitWeight()
      The weight per unit of the item.

      An item can represent multiple units of the same product or variant such as 3 large, red t-shirts. The unitWeight would be the weight of just 1 of those shirts whereas the totalWeight would be the combined weight of all 3.

      Returns:
      The weight per unit of the item.
      See Also:
      • weightUnits
    • getWeightUnits

      public String getWeightUnits()
      The units of measure for unitWeight and totalWeight such as POUNDS or KILOGRAMS.
      Returns:
      The units of weight of this item being paid for by a customer.
    • getFulfillmentFlatRates

      public Map<String,javax.money.MonetaryAmount> getFulfillmentFlatRates()
      Gets the flat rate for fulfilling this item for a particular fulfillment option type. Depending on if the option is configured to use flat rates, this flat rate will be used in calculating the cost of fulfilling this item.
      Returns:
      Map of Fulfillment option types to flat rates for this item.
    • setItemId

      public void setItemId(String itemId)
      The unique identifier for this line item.
      Parameters:
      itemId - The unique identifier for this line item.
    • setSkuCode

      public void setSkuCode(String skuCode)
      The sku code for this item.
      Parameters:
      skuCode - The sku code for this item.
    • setTaxCode

      public void setTaxCode(String taxCode)
      The tax code for this item.
      Parameters:
      taxCode - The tax code for this item.
    • setDescription

      public void setDescription(String description)
      The description for this item.
      Parameters:
      description - The description for this item.
    • setQuantity

      public void setQuantity(int quantity)
      The number of units that make up this item.

      An item can represent multiple units of the same product or variant such as 3 large, red t-shirts. The quantity would thus be 3.

      Parameters:
      quantity - The number of units that make up this item.
    • setUnitPrice

      @Deprecated public void setUnitPrice(javax.money.MonetaryAmount unitPrice)
      Deprecated.
      this is deprecated as the accurate calculation of this value is not feasible for the bundle item, see getMerchandiseTotalAmount()
      The individual unit price for this item.

      An item can represent multiple units of the same product or variant such as 3 large, red t-shirts. The unitPrice would be the price of just 1 of those shirts whereas the subtotal would be the combined price of all 3.

      Parameters:
      unitPrice - The individual unit price for this item.
    • setMerchandiseTotalAmount

      public void setMerchandiseTotalAmount(javax.money.MonetaryAmount merchandiseTotalAmount)
      The total price of all the items. This value is used instead of multiplying the unitPrice by quantity since calculating an accurate unit price from the fulfillment isn't feasible for the bundle products when the bundle's price is prorated to the bundle items.

      For example, the price of the bundle is $30, the first item has quantity 2 and price $9.99, the second has quantity 1 and price $15. The prorated price of the first 2 items will be $17.13 and the second $12.87. In this case if calculate $17.13 / 2 = $8,565, rounded value will be $8,57 and then $8,57 * 2 = $17,14 that is not the same as $17.13.

      Parameters:
      merchandiseTotalAmount - the total price for this items.
    • setUnitWeight

      public void setUnitWeight(BigDecimal unitWeight)
      The weight per unit of the item.

      An item can represent multiple units of the same product or variant such as 3 large, red t-shirts. The unitWeight would be the weight of just 1 of those shirts whereas the totalWeight would be the combined weight of all 3.

      Parameters:
      unitWeight - The weight per unit of the item.
      See Also:
      • weightUnits
    • setWeightUnits

      public void setWeightUnits(String weightUnits)
      The units of measure for unitWeight and totalWeight such as POUNDS or KILOGRAMS.
      Parameters:
      weightUnits - The units of weight of this item being paid for by a customer.
    • setSubtotal

      public void setSubtotal(javax.money.MonetaryAmount subtotal)
      The subtotal of this item being paid for by a customer.
      Parameters:
      subtotal - The subtotal of this item being paid for by a customer.
      See Also:
      • unitPrice
    • setTotalWeight

      public void setTotalWeight(BigDecimal totalWeight)
      The total weight of this item being paid for by a customer.
      Parameters:
      weight - The total weight of this item being paid for by a customer.
      See Also:
      • unitWeight
      • weightUnits
    • setFulfillmentFlatRates

      public void setFulfillmentFlatRates(Map<String,javax.money.MonetaryAmount> fulfillmentFlatRates)
      Gets the flat rate for fulfilling this item for a particular fulfillment option type. Depending on if the option is configured to use flat rates, this flat rate will be used in calculating the cost of fulfilling this item.
      Parameters:
      fulfillmentFlatRates - Map of Fulfillment option types to flat rates for this item.
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • canEqual

      protected boolean canEqual(Object other)
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object